StupidBeauty
Read times:2198Posted at: - no title specified

转载 Solution of java.lang.IllegalArgumentException: View not attached to window manager

如果某个活动已经被销毁,还在该活动的上下文里弹出或者关闭对话框的话,会导致“java.lang.IllegalArgumentException: View not attached to window manager”异常。解决办法就是,在弹出或关闭对话框之前,使用isFinishing()检查一下该活动是否还存活着。

http://www.hankcs.com/program/mobiledev/solution-java-lang-illegalargumentexception-view-not-attached-to-window-manager.html

亮点

@Override

public void dismiss()

{

if (mParentActivity !=  null && !mParentActivity.isFinishing())

{

super .dismiss();     // 调用超类对应方法

}

}

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4