Full Screen Notification only showing as a Heads Up

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.


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.


//in android 10 a permssion is used try it
 
 <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>