How to Detect Call Incoming Programmatically

How to detect Incoming call in background

You have a mistake in your manifest. The following line refers wrongly to the activity:

<receiver android:name="com.app.callrecord.MainActivity">

It should refer to the receiver:

<receiver android:name="SOME_PACKAGE_HERE.MyBroadcastReceiver">

Edit:

If the broadcast receiver doesn't get called, you probably don't have permissions to detect the incoming and outgoing phone calls. You need android.permission.READ_PHONE_STATE and android.permission.PROCESS_OUTGOING_CALLS permissions in your manifest.

How to detect incoming call phone number in Android when app is killed?

Not exactly an answer, but you can create your custom calling app and then make it default by asking for permission. A demo app can be found on this repository. Look at this app code and you might get it.



Related Topics



Leave a reply



Submit