Full Screen Notification only showing as a Heads Up

自闭症网瘾萝莉.ら 提交于 2019-11-30 17:15:19

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!