26
2017
09

FragmentManager is already executing transactions

1. Bug 问题所在

  • 在Fragment里面添加了Fragment,也就是说Fragment里面你可能添加了ViewPager,ViewPager又包裹了Fragment。

2. Bug 出现场景(我个人的)

  • TagLayout+ViewPager,ViewPager包裹Fragment,在Fragment里面又添加了TabLayout+ViewPager,ViewPager中又包裹了Fragment

3. Bug 解决方法

FragmentAdapter adapter = new FragmentAdapter(getActivity().getSupportFragmentManager(), fragments, titleList);

替换为:

FragmentAdapter adapter = new FragmentAdapter(getChildFragmentManager(),fragments,titleList);
上一篇:Fragment no longer exists for key f0: index 0 下一篇:一次ContentProvider踩坑之旅