Fragment错误:IllegalStateException: Can not perform this action after onSaveInstanceState
来源:互联网 发布:王心凌怎么消失了知乎 编辑:程序博客网 时间:2024/05/22 18:13
因为在Fragment所在的Activity中使用了FragmentTransition的 commit方法添加一个Fragment的时候出现的。
commit方法是在Activity的onSaveInstanceState()之后调用的,这样会出错,因为onSaveInstanceState 方法是在该Activity即将被销毁
前调用,来保存Activity数据的,如果在保存玩状态后再给它添加Fragment就会出错。解决办法就 是把commit()方法替换成 commitAllowingStateLoss()就行了。一样用
来自为知笔记(Wiz)
0 0
- Fragment错误:IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决Fragment IllegalStateException: Can not perform this action after onSaveInstanceState
- Fragment IllegalStateException: Can not perform this action after onSaveInstanceState
- fragment 异常IllegalStateException: Can not perform this action after onSaveInstanceState
- Android 错误:IllegalStateException: Can not perform this action after onSaveInstanceState
- 解决fragment错误 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
- 解决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
- 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
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- Canvas、Paint、Path
- 65. PHP 自动加载类
- Java实现生产者与消费者(三)(多生产者多消费者)
- 事件分发机制
- android虚拟键盘InputMethodManager使用
- Fragment错误:IllegalStateException: Can not perform this action after onSaveInstanceState
- Android运行时识别API版本
- MD5校验码的生成与算法实现
- 双击退出程序
- PHP $_FILES错误说明error 0,1,2,3,4,5,6,7
- vlan协议详解
- iOS 面试题整理(题加答案)
- ROS 学习系列 -- 使用Rviz观察智能车的运动轨迹 无陀螺仪计算角度转动
- Knockout介绍