IllegalArgumentException: Window type can not be changed after the window is added

前端 未结 5 674
走了就别回头了
走了就别回头了 2021-01-03 21:21

I\'ve tried the advice here, the advice here, the advice here, I\'ve commented out the onAttachedToWindow() in my Base Activity. I have two Activities inheriting from this

5条回答
  •  一整个雨季
    2021-01-03 21:26

    Remove

    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG|WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    From your onAttachedToWindow(), like this:

     @Override
         public void onAttachedToWindow() {
            //this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG|WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
              super.onAttachedToWindow();
         }
    

提交回复
热议问题