IlleagalStateException: Can not perform this action after onSaveInstanceState
来源:互联网 发布:网页游戏数据报告 编辑:程序博客网 时间:2024/06/09 17:54
IlleagalStateException: Can not perform this action after onSaveInstanceState
在使用fragment 中,有时候会遇到上面的异常。解决这个异常,就需要懂得commit与commitAllowingStateLoss的区别。
可能原因:
1. Fragment之间传参:在设置好参数并且添加add() 或replace()或hide()方法后,需要commit,来实现Fragment之间的跳转。此时系统需要保存参数。但是程序已经实现了跳转,参数还未保存。此时就会报错:IlleagalStateException: Can not perform this action after onSaveInstanceState
解决方法是使用commitAllowinngStteLoss()提交。commitAllowingStateLoss(),从表面就可看出意思是状态值可丢失的提交。
0 0
- IlleagalStateException: Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- Can not perform this action after onSaveInstanceState
- 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
- llegalStateException: 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
- EPC-6708 qt 窗口串口开发环境搭建
- linux基础(33)--正则表达式--RHEL6.5
- Tomcat日志配置远程Syslog采集
- Windows系统日志配置远程Syslog采集
- @NotEmpty、@NotBlank、@NotNull
- IlleagalStateException: Can not perform this action after onSaveInstanceState
- php-扒数据
- 苹果强制适配IPv6-only网络 该怎么做iOS应用兼容适配IPv6 Mac创建 IPV6测试环境
- 任意文本日志配置远程Syslog采集
- 欢迎使用CSDN-markdown编辑器
- RadioButton的背景图片和文字居中对齐
- Duilib编辑器DuiDesigner
- Android保存图片到指定路径
- 剑指offer1