I want to make like this (red area)
Now I do this. (BroadcastReceiver, PhoneStateListener, etc...) show Toast. (ignore 'is null')
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;
}
}
}