I am developing an app that shows the location of the caller when an incoming call come on incoming call screen. I am succesfully fetching the location from my algorithm but I am not able to display it on Deafult Incoming Screen.
If i use A toast then it just appears for 1 or 2seconds, I want ihe information shoulkd appear till the call picked.
What should I use Toast, Notification or something , and how to do that.
In short how can I show something on Incoming Call Screen till the call picked up
class IncomingCallREceiver extends BroadcastReciever
{
void onRecieve()
{
// here I want to show the Information
}
}
You are not able to override Android’s call screen, and with good reason, things may get spoofed!
With that said, a Dialog would most likely be the best solution to showing something before the user picks up. The easiest way to make a Dialog is with DialogFragments. However since Dialogs cannot be shown from receivers, you will need to start an Activity. So your
onReceive()code should look something like this:And then when your DialogActivity is started, it’s
onCreate()method would make the Dialog and show it to the user.