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

后端 未结 8 501
一整个雨季
一整个雨季 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:07

    Use

    getFragmentManager()

    in fragment adapter not child fragment manager

    PagerAdapter adapter = new PagerAdapter(getFragmentManager());
    

    I hope this helps.

提交回复
热议问题