FragmentDialog::Can not perform this action after onSaveInstanceState
来源:互联网 发布:淘宝账号怎么修改密码 编辑:程序博客网 时间:2024/06/17 22:51
在一个程序中使用fragment+异步更新界面,今天出现发现异常,记录解决办法。
异常:java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState;
分析:仔细查看后发现,是由于异步线程结束后,要弹出对话框提示,但是这时候fragment已经进入后台,所以抛出这个异常;
解决办法:在线程运行结束后,需要弹出对话框的时候,先做一个判断isResumed()。google给的文档中是这样说的:
public final boolean isResumed ()
Return true if the fragment is in the resumed state. This is true for the duration of onResume()
and onPause()
as well.
1 0
- FragmentDialog::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
- Android开发之列出所有启动的服务以及判断某个服务是否启动
- linux命令
- ubuntu下的unix2dos和dos2unix
- 颜色选取和转换小工具
- VS2010中创建COM组件并用C++及C#测试
- FragmentDialog::Can not perform this action after onSaveInstanceState
- 读书笔记-APUE第三版-(1)UNIX系统概述
- 【linux驱动分析】之dm9000驱动分析(二):定义在板文件中的资源和设备以及几个宏
- input_event
- 关于DataGridView中当前行改变的事件
- CRecordset::EDIT
- 机型适配的一点小问题
- pat1077
- jstl字符串处理