Can not perform this action after onSaveInstance错误
来源:互联网 发布:化妆品成分知多少 编辑:程序博客网 时间:2024/05/02 00:34
测试部挂monkey,跑出个这么个崩溃日志,分析来分析去也没分析出什么问题。
从搜索来看,还是有人遇到这个问题。
记录下。
http://zhiweiofli.iteye.com/blog/1539467
关于onSaveInstance方法和commit方法之间的关系,在FragmentManager.java (./framework/base/core/java/android/app/FragmentManager.java)
/** * Start a series of edit operations on the Fragments associated with * this FragmentManager. * * <p>Note: A fragment transaction can only be created/committed prior * to an activity saving its state. If you try to commit a transaction * after {@link Activity#onSaveInstanceState Activity.onSaveInstanceState()} * (and prior to a following {@link Activity#onStart Activity.onStart} * or {@link Activity#onResume Activity.onResume()}, you will get an error. * This is because the framework takes care of saving your current fragments * in the state, and if changes are made after the state is saved then they * will be lost.</p> */ public abstract FragmentTransaction beginTransaction();
从上面可以看出,transaction的创建以及commit必须比activity的save要早。
从
private void checkStateLoss() { if (mStateSaved) { throw new IllegalStateException( "Can not perform this action after onSaveInstanceState"); } if (mNoTransactionsBecause != null) { throw new IllegalStateException( "Can not perform this action inside of " + mNoTransactionsBecause); } }
分析log,量的时候比较轻松,量多了,整个十几个压缩包,真是一件痛苦的事。
因此,分析log掌握方法很有必要。比如查找对应的导致FC的进程id,然后根据这个id 顺藤摸瓜,或者根据事件code,比如keyCode = 4 是返回键,此时,
adb等工具命令排上用场。
0 0
- Can not perform this action after onSaveInstance错误
- java.lang.IllegalStateException: Can not perform this action after onSaveInstance
- android异常:Can not perform this action after onSaveInstance
- 解决java.lang.IllegalStateException: Can not perform this action after onSaveInstance
- 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
- 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
- Python学习笔记 访问数据库
- 开发者眼中的PhoneGap体验
- UVA 714 Copying Books(最大值最小化)
- [C++]LeetCode: 133 Largest Rectangle in Histogram(最大矩形面积)
- 零基础学习 nginx + tomcat
- Can not perform this action after onSaveInstance错误
- Python学习笔记 web开发
- SG函数模板
- 函数递归的优缺点
- 为什么最大值加一等于最小值
- Python学习笔记 协程
- Linux Shell编程基础
- 基于HTML5移动Web应用开发框架 jQuery Mobile
- 最短路