java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState解决?
做项目到最后整合的时候测试的时候发现 切换tab更换fragment的时候抛出了这个异常,根据异常信息Can not perform this action after onSaveInstanceState,
定位到:
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager
.beginTransaction();
transaction
.replace(R.id.ll_content, new SellerFragment());
transaction.commit();
可以了解到异常原因:在onSaveInstanceState行为之后,app执行某个不能响应的行为而导致异常发生。也许你并没有用saveInstance手动的保存当前的状态但是也报了这个错误。
然后有人说:
把
transaction.commit();
方法替换成
transaction.commitAllowingStateLoss()就行
了,其效果是一样的。然后试了下果真解决了。
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState解决?的更多相关文章
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState问题解决
(1)我用的是fragment,在onStop但是没有onDestroy的情况下切换(replace)fragment时报 java.lang.IllegalStateException: Can n ...
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
在使用Fragment的过程中,常常会遇到在Activity的onSaveInstanceState方法调用之后,操作commit或者popBackStack而导致的crash. 因为在onSaveI ...
- 解决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
今天使用Fragment的时候,出现了这个错误 IllegalStateException: Can not perform this action after onSaveInstanceState ...
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState:
今天做项目中的支付宝功能,是在fragment中做的,在支付成功后,想切换到支付成功的页面. 结果就报错了IllegalStateException: Can not perform this act ...
- IllegalStateException: Can not perform this action after onSaveInstanceState
http://www.cnblogs.com/zgz345/archive/2013/03/04/2942553.html 今天使用Fragment的时候,出现了这个错误 IllegalStateEx ...
- Android 错误:IllegalStateException: Can not perform this action after onSaveInstanceState
今天做Fragment切换.状态保存功能的时候,出现了这个错误: E/AndroidRuntime(12747): Caused by: java.lang.IllegalStateException ...
- [Android Pro] java.lang.IllegalStateException: Fragment(XXFragment) not attached to Activity异常
转载:http://blog.csdn.net/winson_jason/article/details/20357435 下边两个问题,是在开发中碰到的一些关于Fragment的偶发性的问题,今天时 ...
- Can not perform this action after onSaveInstanceState
java.lang.RuntimeException: Unable to resume activity {com.tongyan.nanjing.subway/com.tongyan.struct ...
随机推荐
- Text Justification [LeetCode]
Problem Description:http://oj.leetcode.com/problems/text-justification/ Note: Just be careful about ...
- 221. Maximal Square -- 矩阵中1组成的最大正方形
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and re ...
- 读书笔记2:HTTP协议
HTTP是什么 HTTP定义 HTTP( Hypertext Transfer Protocol, 超文本传输协议) 是在万维网上进行通信时所使用 的协议方案. HTTP的地位 了解HTTP协议的地位 ...
- MVC中使用HTML Helper类扩展HTML控件
文章摘自:http://www.cnblogs.com/zhangziqiu/archive/2009/03/18/1415005.html MVC在view页面,经常需要用到很多封装好的HTML控件 ...
- Vim经典讲解
http://blog.csdn.net/niushuai666/article/details/7275406
- js在前端获取在本地上传图片的尺寸
var MyTest = document.getElementById("upload_img").files[0];var reader = new FileReader(); ...
- H5网页动画制作(页面切换、效果等)
网址 http://www.ih5.cn/#mine/home/194080 13482289820 视频教程 http://file.ih5.cn/?nid=713629&key=aef10 ...
- SSH由WAS/Tomcat/Weblogic迁移到JBOSS
又是一个凌晨,又一次搞项目在新的中间件上的可部署性验证... 原来将项目部署到was7上,花了三个晚上到凌晨1点多的时间,总结出了只要将common-logging和wodenxx.jar两个jar包 ...
- jquery返回上一页面
window.location.href=document.referrer; 返回然后刷新 window.history.back(-1); 返回不刷新
- 转: Jsp9个内置对象详解
1.request对象 客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求, 然后做出响应.它是HttpServletRequest类的实例. 序号方法说明 objectgetA ...