启动v4.DialogFragmet触发RuntimeException:Unable to stop activity
来源:互联网 发布:移动网络玩lol哪个区 编辑:程序博客网 时间:2024/09/21 06:16
经测试,当在onStop方法里显示DialogFragment是,会出现IllegalStateException异常:Can not perform this action after onSaveInstanceState...
但是在onPause方法里启动DialogFragment不会出现问题
通过上面两点可以再当前的onStop和onResume方法里记录变量,来表示当前activity的状态是否适合启动DialogFragment。
注意:
protected void onSaveInstanceState (Bundle outState)
If called, this method will occur before
onStop()
. There are no guarantees about whether it will occur before or after onPause()
.所以,在onPause()和onSaveInstanceState()方法里同时设置变量状态,则不会出现此问题。
0 0
- 启动v4.DialogFragmet触发RuntimeException:Unable to stop activity
- Unable to stop activity
- java.lang.RuntimeException: Unable to stop activity {com.borqs.musicdemo/com.borqs.musicdemo.MainAct
- RuntimeException:Unable to start activity ComponentInfo
- java.lang.RuntimeException: Unable to instantiate activity
- RuntimeException: Unable to bind views for activity.....
- java.lang.RuntimeException: Unable to destroy activity
- java.lang.RuntimeException: Unable to destroy activity
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
- java.lang.RuntimeException: Unable to start activity ComponentInfo
- AndroidRuntime(21900): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常解决
- java.lang.RuntimeException: Unable to start activity ComponentInfo解决方案
- java.lang.RuntimeException: Unable to start activity ComponentInfo解决方案
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常解决
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常解决
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常总结
- [解决方案]java.lang.RuntimeException:Unable to instantiate activity ComponentInfo
- [BZOJ4520][CQOI2016] K远点对 - KD-tree
- nginx下载、windows系统安装、设置欢迎页
- 内存溢出原因及解决方案
- Android UI线程和非UI线程
- PHP笔记(碎片代码) - 选择MySQL数据库
- 启动v4.DialogFragmet触发RuntimeException:Unable to stop activity
- svn清理失败(clean up失败)的解决方法
- 互联网+SC联盟解决大学生五大难题!
- 让DIV水平和垂直居中
- Guava库学习:学习使用Preconditions工具类进行代码的校验
- JAVA中String类深度探究
- 无人机为什么偏爱多旋翼?这里有最全的解释
- MongoDB数据分析之MapReduce
- Web自动化系列--一个基于关键字驱动的自动化测试Library