关于dialog引起的 java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView not attached to window manager 错误的分析
在跑Monkey测试的时候出现了一个比较特别的问题,先来看看Log:
// CRASH: com.meizu.media.painter (pid 12491) // Short Msg: java.lang.IllegalArgumentException // Long Msg: java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{21dd6762 V.ED.... R......D 0,0-538,105} not attached to window manager // Build Label: *** // Build Changelist: 1443062570 // Build Time: 1443062722000 // java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{21dd6762 V.ED.... R......D 0,0-538,105} not attached to window manager // at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:416) // at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:342) // at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:116) // at android.app.Dialog.dismissDialog(Dialog.java:354) // at android.app.Dialog.dismiss(Dialog.java:337) // at com.***.***.***.PainterDrawActivity.closeProgressDialog(PainterDrawActivity.java:60) // at com.***.***.painter.PainterDrawActivity.access$000(PainterDrawActivity.java:28) // at com.***.***.painter.PainterDrawActivity$1$2.run(PainterDrawActivity.java:49) // at android.os.Handler.handleCallback(Handler.java:815) // at android.os.Handler.dispatchMessage(Handler.java:104) // at android.os.Looper.loop(Looper.java:194) // at android.app.ActivityThread.main(ActivityThread.java:5741) // at java.lang.reflect.Method.invoke(Native Method) // at java.lang.reflect.Method.invoke(Method.java:372) // at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980) // at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775) //
从上面的Log可以看出是一个非法参数异常的问题。
那为什么会出现Long Msg: java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{21dd6762 V.ED.... R......D 0,0-538,105} not attached to window manager的问题呢?应用本身的崩溃怎么会联系到
PhoneWindow呢?
(1). 为什么报错com.android.phone已停止运行?
(2). 为什么会报View not attached to window manager错误?
(3). 为什么Activity会被"杀掉"?
由于是Monkey测试出现一次的Log,我们很难复现,只能从网上遇到类似问题的人看看他们的看法。
(4). 在SActivity被杀掉时,Dialog存在么?
(5). 如何解决这个问题呢?
1. 使用Activity自带的Dialog控制方法
2. 限制Dialog的生命周期
关于dialog引起的 java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView not attached to window manager 错误的分析的更多相关文章
- 关于java.lang.IllegalArgumentException: View not attached to window manager 错误的分析
今天遇到一个很奇特的问题,当用户设置了PIN码,在锁屏界面正常解锁PIN码后,进入Launcher时显示com.android.phone 已停止运行.一开始猜想会不会是解锁PIN码的时候处理导致了P ...
- android在学习——activity关闭和dialog.dismiss冲突的解决(Activity has leaked window com.android.internal.policy.impl.PhoneWindow)
当我们在退出整个程序的时候偶尔会出现这种报错:Activity has leaked window com.android.internal.policy.impl.PhoneWindow 其意思大概 ...
- decorview that was originally added here or java.lang.IllegalArgumentException: View not attached to window manager
使用Dialog的时候,没少出现下面这两个报错 12-11 17:47:49.776: E/WindowManager(11461): android.view.WindowLeaked: Activ ...
- java.lang.IllegalArgumentException: View not attached to window manager
公司项目线上bug: java.lang.IllegalArgumentException: View not attached to window manager at android.view.W ...
- 继承映射中的java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: person is not mapped [FROM person]
继承映射中查询对象的过程中报错: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxExcep ...
- java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped
Spring 5.0 +Jpa,使用@Query实现 自定义查询报错: java.lang.IllegalArgumentException: org.hibernate.hql.internal.a ...
- Android中 View not attached to window manager错误的解决办法
前几日出现这样一个Bug是一个RuntimeException,详细信息是这样子的:java.lang.IllegalArgumentException: View not attached to w ...
- bug_ _java.lang.IllegalArgumentException: View not attached to window manager 2
今天遇到一个很奇特的问题,当用户设置了PIN码,在锁屏界面正常解锁PIN码后,进入Launcher时显示com.android.phone 已停止运行.一开始猜想会不会是解锁PIN码的时候处理导致了P ...
- bug_ _java.lang.IllegalArgumentException: View not attached to window manager
============= 1 view not attached to window manager 转自:http://hi.baidu.com/spare_h/blog/item/7fa3e ...
随机推荐
- html5 svg 第八章 文字text
虽然它可能是真实的,每一个画面讲述了一个故事,这是完全正确的,用言语来帮助讲故事.因此,SVG有几个元素,让你将文本添加到您的图形. 文本术语 Text Terminology 在我们调查的主要方法添 ...
- C# 线程知识--使用ThreadPool执行异步操作
C# 线程知识--使用ThreadPool执行异步操作 在应用程序中有许多复杂的任务,对于这些任务可能需要使用一个或多个工作线程或I/O线程来协作处理,比如:定时任务.数据库数据操作.web服务.文件 ...
- http://www.cnblogs.com/eye-like/p/4121219.html
c# 操作Word总结 在医疗管理系统中为保存患者的体检和治疗记录,方便以后的医生或其他人查看.当把数据保存到数据库中,需要新建很多的字段,而且操作很繁琐,于是想到网页的信息创建到一个word文本中, ...
- ReentrantReadWriteLock读写锁的使用
Lock比传统线程模型中的synchronized方式更加面向对象,与生活中的锁类似,锁本身也应该是一个对象.两个线程执行的代码片段要实现同步互斥的效果,它们必须用同一个Lock对象. 读写锁:分为读 ...
- Failed to load unit 'PATM' (VERR_SSM_FIELD_NOT_CONSECUTIVE)
今天打开虚拟机启动的时候报错:Failed to load unit 'PATM' (VERR_SSM_FIELD_NOT_CONSECUTIVE) 后来发现虚机处于休眠状态,所以在虚机上右键,然后清 ...
- 安装qc 出现error An error occurred while attempting to connect to the database.
When trying to install mercury quality center starter edition 9.0 on Windows XP media center, I am g ...
- codevs 3160 最长公共子串(SAM)
3160 最长公共子串 题目描述 Description 给出两个由小写字母组成的字符串,求它们的最长公共子串的长度. 输入描述 Input Description 读入两个字符串 输出描述 Ou ...
- 使用Windows Azure创建Windows系统虚拟机-上
创建虚拟机来运行Windows 本教程介绍了如何轻松创建运行Windows 的 Azure虚拟机(VM),用作来自Azure管理门户中映像图库的Windows 服务器映像.映像图库提供了多种图像,包括 ...
- Script.NET Perl解释器代码已经在GitHub开源发布
Script.NET Perl解释器的代码已经提交到GitHub网站.GitHub项目地址: https://github.com/blueantst/Script.NET Perl解释器代码在Src ...
- MySQL 5.7 for Windows 解压缩版 MySQL 服务无法启动
MySQL 5.7 for Windows 解压缩版配置安装 http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html basedi ...