Comments (3)
@ymcao
这个异常是因为 你在Fragment的状态被保存之后(即onSaveInstanceState被调用之后),又进行commit一个FragmentTransaction事务导致的;
这种情况解决办法一般是 把逻辑修改下,把事务提交放到Fragment的onResume中,不建议使用网上的commitAllowingStateLoss()方式!
from fragmentation.
情况是这样的 我在mainfragment中有4个tab,然后第四个tab(使用的是demo中的bottombar),点击去设置页面退出登录,发送了个event,在mainfragment的event接受中,调用setCurrentItem(0),偶尔会出现上面的异常崩溃
from fragmentation.
你检查下在这个过程中showHideFragment(这个方法本质就是一个FragmentTransaction事务)的调用前,是否已经保存了状态(onSaveInstanceState)
这里给一个链接,对这个异常的描述,以及解决方案:
http://www.cnblogs.com/kissazi2/p/4181093.html
from fragmentation.
Related Issues (20)
- viewpager嵌套viewpager,中第二个viewpager中的onLazyInitView和onSupportVisible步骤 HOT 1
- 不维护可能是随着谷歌逐步对fragment的优化,作者觉得越来越鸡肋了吧 HOT 2
- 结合ViewPager的父布局底部会被键盘顶起 HOT 3
- 废弃的原因是什么 HOT 4
- fragment栈的问题 must call loadRootFragment first HOT 1
- EasyFragmentation
- google 官方fragment 导航框架 navigation-fragment+navigation-ui HOT 7
- 消息队列管理为什么size==1才执行 ,如果>1 那么岂不是无法执行了? HOT 2
- viewpager上有输入框,输入框会把底部导航栏顶起来怎么怎么解决 HOT 1
- Fragmentation升级版, 欢迎试用
- 这么好的开源库放弃更新太可惜了,有大佬能和作者接触下接手吗? HOT 5
- 字体大小异常问题
- Fragmentation升级版,欢迎试用 HOT 1
- 如果viewpager在activity第一层级,初始化的时候viewpager中所有fragment的onLazyInitView都会被回调 HOT 2
- 为什么在Handler.post里调用onSupportVisible, 而不是直接调用? HOT 1
- popTo() has not been attached yet HOT 2
- onSupportVisible 在三星note5、s6上 不可用
- JCenter to be dismissed - please migrate to Maven Central HOT 1
- 使用popTo方法时被pop的Fragment不会调用onDestroy方法
- pop 动画在高版本(SDK 31,androidx.fragment 1.3.6)上异常
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fragmentation.