STACK_TRACE=java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
来源:互联网 发布:windows优化大师 7.2 编辑:程序博客网 时间:2024/06/16 02:26
崩溃信息如下:
STACK_TRACE=java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.p.g(FragmentManager.java:1538)at android.support.v4.app.p.z(FragmentManager.java:1556)
at android.support.v4.app.BackStackRecord.z(BackStackRecord.java:696)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:662)
at ....
原因是activity被销毁回收后,还在执行一些UI操作,如fragment替换,dialog显示等。
我遇到的是fragment替换
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();ft.replace(R.id.search_result, mSearchFragment);ft.commit();
解决方法:
if (isFinishing()) { return;}...FragmentTransaction ft = getSupportFragmentManager().beginTransaction();ft.replace(R.id.search_result, mSearchFragment);ft.commitAllowingStateLoss();
阅读全文
0 0
- STACK_TRACE=java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException:Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState问题解决
- Fragment解决java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- Mac配置安装OCR过程
- TypeScript类、接口、继承
- c#怎样在第2个窗体关闭时将数值返回给第一个窗体
- 【Y分钟内迅速学会python3系列】 python学习记录 (一)
- Python爬虫爬取古诗文网站项目分享
- STACK_TRACE=java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- Django 安装
- 171026 逆向-Patch(CrackMe之41)
- 树莓派安装ROS
- easyui datagrid 表头样式
- Guava之二维矩阵Table
- 分布式环境必备技能之分布式锁
- [Android开发]错误汇总
- PAT 1024