IllegalStateException: Can not perform this action after onSaveInstanceState
来源:互联网 发布:ie修复软件下载 编辑:程序博客网 时间:2024/05/18 04:38
今天在使用fragment的适合遇到如下错误,解决了,记录下来方便以后查看
IllegalStateException: Can not perform this action after onSaveInstanceState
是在使用FragmentTransition的 commit方法添加一个Fragment的时候出现的
commit方法是在Activity的onSaveInstanceState()之后调用的,这样会出错,因为
onSaveInstanceState方法是在该Activity即将被销毁前调用,来保存Activity数据的,如果在保存玩状态后
再给它添加Fragment就会出错。解决办法就是把commit()方法替换成 commitAllowingStateLoss()就行
了,其效果是一样的。
0 0
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- Android 异常 IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决Fragment IllegalStateException: Can not perform this action after onSaveInstanceState
- IllegalStateException: Can not perform this action after onSaveInstanceState解决办法
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- Fragment IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决异常IllegalStateException: Can not perform this action after onSaveInstanceState
- IllegalStateException: Can not perform this action after onSaveInstanceState解决办法
- IllegalStateException: Can not perform this action after onSaveInstanceState
- cocos2d 游戏开发实战
- 圆的比较
- Android 开发中的多线程编程技术
- DES 加密解密算法的C++实现
- Mybatis分页插件2.0版本发布
- IllegalStateException: Can not perform this action after onSaveInstanceState
- table自定义排序
- 大数据的数据存储与分析
- Android学习——ClickableSpan点击链接事件 改超链接颜色
- DES加密解密的C++源程序
- spring mvc 整合 velocity
- DES加密解密字符串的JAVA实现(lp)
- R语言系列:数据的基本运算
- winrar 5.0 破解