android:Can not perform this action after onSaveInstanceState解决方法
来源:互联网 发布:淘宝网男士长袖t恤 编辑:程序博客网 时间:2024/06/03 00:11
今天在做项目的时候遇到这个问题:android:Can not perform this action after onSaveInstanceState;看了下fragment的源码
/** * Schedules a commit of this transaction. The commit does * not happen immediately; it will be scheduled as work on the main thread * to be done the next time that thread is ready. * * <p class="note">A transaction can only be committed with this method * prior to its containing activity saving its state. If the commit is * attempted after that point, an exception will be thrown. This is * because the state after the commit can be lost if the activity needs to * be restored from its state. See {@link #commitAllowingStateLoss()} for * situations where it may be okay to lose the commit.</p> * * @return Returns the identifier of this transaction's back stack entry, * if {@link #addToBackStack(String)} had been called. Otherwise, returns * a negative number. */ public abstract int commit();
大概意思是这样的:
/ * *
*安排本次交易的提交。提交并
*不会立即发生;它将被安排在主线程上工作
*要做下一次线程准备。
*
*“P”类=“备注”>一个事务只能用这种方法进行
*在其包含活动保存其状态之前。如果提交的是
*尝试在这一点之后,将抛出一个异常。这是
*因为如果活动需要的话,提交后的状态会丢失
*从它的状态恢复。看到{@链接# commitallowingstateloss() }为
*情况下,它可能是好的,失去了承诺。
*
“返回返回此事务的返回堆栈项的标识符,
*如果{@链接# addtobackstack(字符串)}被称为。否则,返回
*一个负数。
- /
公共commit()摘要int;
因此我知道了commitallowingstateloss()这个方法可以解决;
0 0
- android: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
- Android 异常 IllegalStateException: Can not perform this action after onSaveInstanceState
- 【遇见Android bug】Can not perform this action after onSaveInstanceState
- Android - IllegalStateException: Can not perform this action after onSaveInstanceState
- Android error:Can not perform this action after onSaveInstanceState
- Android can not perform this action after onSaveInstanceState 问题解决
- Android 错误:IllegalStateException: Can not perform this action after onSaveInstanceState
- android异常:Can not perform this action after onSaveInstanceState
- Python 网络爬虫 009 (编程) 通过正则表达式来获取一个网页中的所有的URL链接,并下载这些URL链接的源代码
- 监听应用的安装和卸载
- 济南违停扣分主干道
- Structs2开发
- 关于运行时异常:Calling startActivity() from outside of an Activity
- android:Can not perform this action after onSaveInstanceState解决方法
- svn 回退/更新/取消至某个版本命令详解
- MySql数据库主从配置
- Spring官网下载各版本jar包
- Android常用多渠道打包方式实践
- mysql 触发器trigger
- Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www
- Ext.encode 与 Ext.decode
- iOS学习笔记 APP启动相关