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

前端 未结 5 713
走了就别回头了
走了就别回头了 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:32

    I also had this problem, but I solved it by removing the Window, changing the params and then adding the window again. This was good enough for me.

    WindowManager.removeView(View); params = params2; //changed the params to something else WindowManager.updateViewLayout(View, params); WindowManager.addView(View, params);

提交回复
热议问题