Full Screen Notification only showing as a Heads Up

前端 未结 2 1667
春和景丽
春和景丽 2020-12-30 23:02

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

相关标签:
2条回答
  • 2020-12-30 23:03

    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.

    0 讨论(0)
  • 2020-12-30 23:13

    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.

    0 讨论(0)
提交回复
热议问题