View not attached to window manager
来源:互联网 发布:优化推广什么意思 编辑:程序博客网 时间:2024/05/22 01:44
记录一下最近项目中常报的异常,如下:
java.lang.IllegalArgumentException: View .......not attached to window manager
原因:在服务中实现动态窗口渲染,每次控件初始化(onCreate()方法中)时,WindowManager和View绑定一次,
在一些特殊情况下,比如浮动窗口突然消失,而服务还存在时,再次使其弹出窗口时,它就不会走初始化那个方法,所以会
出现这个WindowManager没有绑定View的异常。
解决办法;就是需要Service与窗口同步,当窗口消失的时候,Service应该被杀掉或者自己停掉自己,如stopself()。
再次弹出窗口时,就使服务重新执行初始化,重新绑定WindowManger。
阅读全文
0 0
- view not attached to window manager
- View not attached to window manager
- illegalargumentexception: view not attached to window manager
- View not attached to window manager
- View not attached to window manager解决方案
- View not attached to window manager
- View not attached to window manager解决方案
- View not attached to window manager解决方案
- View not attached to window manager解决方案
- View not attached to window manager解决方案
- View not attached to window manager解决方案
- View not attached to window manager解决方案
- View not attached to window manager
- android View not attached to window manager
- View not attached to window manager
- View not attached to window manager
- not attached to window manager
- java.lang.illegalargumentexception view not attached to window manager 解决
- es6你不知道的小知识点
- 烟台大学新秀赛 C.谁没有关灯?【进制转换】
- css复习——定位、全屏div、div居中、calc函数
- Algorithm6——栈的应用
- Jzoj3523 JIH的玩偶
- View not attached to window manager
- bzoj1493 线段树
- [高等数学]导数与微分
- 谈谈LCA和RMQ那些事。。。
- 第十二课 联结表
- C#代码实现 快速排序
- Redis集群的几个注意事项
- elasticsearch vs mongodb
- JAVA Freemarker(4)-- 语法大全