intercept the Android's OS incoming call screen and replace

前端 未结 3 1859
[愿得一人]
[愿得一人] 2021-02-02 14:29

I would like to intercept the Android\'s OS incoming call screen and replace it with my app\'s incoming call screen. However, there is no API to do so, but I know for sure it is

3条回答
  •  攒了一身酷
    2021-02-02 15:00

    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.

    At least the same strategy works with incoming SMS' - I used to do as described above.

提交回复
热议问题