dialog , not attached to window manager
来源:互联网 发布:简单有趣的c语言程序 编辑:程序博客网 时间:2024/06/05 04:52
此问题,是由于在 正常操作逻辑下, 7.0手机在本应用,进入分屏模式导致出现的
看代码
是由于, 进入分屏模式下,界面重新oncreate , 而之前的创建的 Dialog
进行 show, set, dissmiss 等操作的话,肯定就所依赖的之前那个 Activity窗口就不在了
可以有2种解决方案
所有在 dialog 操作的地方监听一下是否 为null, 不为null 再执行操作
然后在界面 ondestory 方法里, 设置 dialog = null ,这种情况如果是在维护之前项目老代码的基础上,感觉工作量还挺大,因为毕竟接手过很多的人,每个人写代码的方式都不一样 dialog 创建也奇奇怪怪的, 我就遇到一个 是写在
handler 里面的在 Manifest 中配置,onconifgchange 输出属性,配置好后, Activity 就不会销毁重新创建了
阅读全文
0 0
- dialog , not attached to window manager
- 自定义Dialog dismiss时 View not attached to window manager
- not attached to window manager
- 使用Dialog出现的has leaked window和not attached to window manager
- 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解决方案
- progressDialog not attached to window manager error!
- View not attached to window manager
- arm linux 临时页表的建立
- 经典数据结构-红黑树详解(转)
- web基础开发(五)
- Retrofit用法详解
- oracle安装问题解决
- dialog , not attached to window manager
- 百度地图01
- 单发群发邮件
- 多线程面试题
- Java实现-链表求和
- Comparable 与 Comparator 比较
- 【修改谷歌浏览器chrome记住密码后自动填充表单的黄色背景】
- 【Python】Python错误类型03
- QTime