Show my activity instead of the standard screen for an incoming call

I am developing an application for Android 2.3.3. It contains several EditViews for displaying information for an incoming call: country, current time, phone number ... I know how to get and show this information. The problem I am facing is that I do not know how to show my activity instead of the standard screen for incoming calls.

Now it displays information after incoming calls.

How to do it?

+4
source share
3 answers

It's impossible. According to PhoneApp , the intention to launch InCallScreen is tied to the phoneapp, you have no chance to intercept this. Thus, the screen will be displayed every time.

What you can try to do is notify TelephonyManager when the phone goes to CALL_STATE_RINGING , and then draw your interface only on InCallScreen. It may be possible, but you cannot cancel the call (unsure, but I don’t think so) from your user interface. Also, the state is not set immediately when InCallScreen pops up, it is delayed for several milliseconds.

+2
source

Take a look at questions about displaying pop-ups on the incoming call screen:
Incoming call screen popup
Android Incoming Call Screen

If it is not enough to display a pop-up window on the interface of an incoming call, you can make a pop-up window in full screen to hide it. At this point, you will need a way to accept an incoming call without showing the default incoming call screen (which you are closing now). A quick search is this answer that offers a workaround for accepting an incoming call. I am not sure if there is an official API for this.

+2
source

It is not possible to remove the default user interface of an incoming call in android unless you change the encoding of the Android OS. But instead, you can use your own default user interface. This is achieved using the Thread concept (to make the UI enabled by default)!

+1
source

Source: https://habr.com/ru/post/1396131/


All Articles