1

I want to make like this (red area)

enter image description here

Now I do this. (BroadcastReceiver, PhoneStateListener, etc...) show Toast. (ignore 'is null')

enter image description here

But I don't know how to Show Overlay when RINGING and hide when IDLE (Or connected). When I show Activity, It shows when calling is over.

How can I do that?

Code is like this

public class MyPhoneStateListener extends PhoneStateListener { Context context; Intent intent; public MyPhoneStateListener(Context context) { super(); this.context = context; } @Override public void onCallStateChanged(int state, String incomingNumber) { switch (state) { case TelephonyManager.CALL_STATE_IDLE: // Hide popup break; case TelephonyManager.CALL_STATE_RINGING: // Show popup break; default: break; } } } 
2

1 Answer 1

1

You need a custom Toast and a BroadcastReceiver(as you rightly mentioned) There is a very good blogpost on how to customise a Toast in here: http://www.learn-android-easily.com/2013/05/customiozing-toast-in-android.html

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.