I am designing a custom calling screen to show information, such as the caller’s address book info, on screen during the phone conversation.
My app will begin when the user presses the call button by use of an Intent Filter, after which I will fetch other information from the address book and add it to the screen.
My problem is that when the call button is pressed, my activity is not launching. Is my intent filter right? Is it even possible to intercept the phone call Intent? Please share your knowledge on handling call event.
My Intent Filter is shown below.
<activity android:name=".MyCallingScreen">
<intent-filter android:priority="100">
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
In your case try to change your code following way:
It’s work for me if press on a call button.
Try to use following code to intercept the call:
For HTC some changes there:
Intent with action android.intent.action.CALL_PRIVILEGED is called when you making a call from phonebook by following way: Phone Book->Contact->Phone number Long Click -> Choose make call from dropdown menu.