android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is yo
来源:互联网 发布:cr173破解软件 编辑:程序博客网 时间:2024/05/22 10:32
popUpWindow出现以上问题的原因是popUpWindow的弹出需要依附一个activity,所以需要在activity渲染完成之后弹出activity
解决方法一:使用handler延时显示,在handler中调用显示popUpWindow的方法
private Handler popupHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case 0: remiderUserSign(); break; } }};
解决方法二:重写onWindowFocusChanged方法,在里面调用显示
@Overridepublic void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if(hasFocus && !isRemiderUserSignShow){ isRemiderUserSignShow = true; remiderUserSign(); }}综上,还是推荐方法二,因为方法一不能彻底解决以上问题(在某些机型上面会报错误)
0 0
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is yo
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is yo
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is yo
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid
- android.view.WindowManager$BadTokenException:Unable to add window --token is not valid; is your acti
- Android报错android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- 关于android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an app
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- Python+Selenium练习篇之8-利用css定位元素
- java 中的集合(三) ArrayList源码分析
- 渐变色的3D柱子,超出100%后变红
- test
- K
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is yo
- Q&A——资源管理(七)
- java 中的集合(四) Vector源码分析
- hibernate学习之继承映射
- java synchronized
- JS创建Img元素
- spring cloud 学习笔记1-依赖包介绍
- node.js搭建服务器
- JSON对象、中文乱码及时间转换-默然说话20170331备课笔记