java.lang.IllegalStateException: Fragment no longer exists for key f1: index 3

后端 未结 8 606
一整个雨季
一整个雨季 2020-12-24 10:43

I want to understand this exception in order to implement a proper fix.

There\'s a ViewPager and it uses a FragmentStatePagerAdapter to instantiate 2 fragments via g

8条回答
  •  执笔经年
    2020-12-24 11:03

    If you don't want the fragments to get reclaimed when they are offscreen, you should be using FragmentPagerAdapter and not FragmentStatePagerAdapter.

提交回复
热议问题