I have been banging my head against the table with this problem for 3 days now, please tell me where I have strayed.
When I am getting an incoming VoIP call, I am try
If I understood your question correctly, you forgot to add flag WindowManager.LayoutParams.FLAG_FULLSCREEN
in IncomingCallActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().addFlags(flags);
This combination needed to show activity while screen is locked. Hope it helps.
Figured it out! It was something stupid just as I suspected.
In my IncomingCallActivity I had the following bit of code
public void onPause() {
super.onPause();
finish();
}
It turns out that something having to do with how Notifications get shown actually calls onPause
, therefore finishing the activity.
Thanks to @JohanShogun for attempting to help out.