0

How we can intercept incoming call in android? i have to stop incoming call in default application, any one have any idea please give me direction Thanks

Android007
  • 121
  • 1
  • 1
  • 10

3 Answers3

0

You should extend a BroadcastReceiver and then register it.

In code:

CallReceiver callReceiver = new CallReceiver();
IntentFilter callFilter = new IntentFilter(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
registerReceiver(callReceiver, callFilter);

Or register in your manifest file.

<receiver android:name="CallReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PHONE_STATE"></action>
        </intent-filter>
    </receiver>
user123321
  • 12,593
  • 11
  • 52
  • 63
0

Yes We Can Intercept incoming Call by Using Hack Code of Itelyphony Interface. It simply create an instance of telyphiny service and it has a method to end incoming call.

telephonyService.endCall();
bindal
  • 1,940
  • 1
  • 20
  • 29
-1
<uses-permission android:name="android.permission.CALL_PHONE" />
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:0377778888"));
startActivity(callIntent);
PeterPan
  • 1
  • 1