I am currently intercepting a call and forwarding it to my customized "oncallscreen" activity. However, before getting to my screen it will flash to the default "oncallscreen". How can I hide/cancel this screen so when receiving call I get only my customized screen.
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
if (extras != null) {
String state = extras.getString(TelephonyManager.EXTRA_STATE);
Log.w("DEBUG", state);
if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
String phoneNumber = extras
.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
You need to intercept broadcast android.intent.action.PHONE_STATE
with highest possible priority, then if in your BroadcastReceiver.onReceive()
you will cancel broadcast through BroadcastReceiver.abortBroadcast()
you will be able to stop default incoming call screen to be shown, since default application won't receive incoming call broadcast. After that you're free to show your own Activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With