Full Screen Notification only showing as a Heads Up

前端 未结 2 1675
春和景丽
春和景丽 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.

提交回复
热议问题