IllegalStateException: is not currently in the FragmentManager

后端 未结 12 2132
予麋鹿
予麋鹿 2021-01-31 08:40

I know it sounds like a duplicate of FragmentStatePagerAdapter IllegalStateException: is not currently in the FragmentManager but his solution isn\'t relevan

12条回答
  •  借酒劲吻你
    2021-01-31 09:30

    If your ViewPager is layouted inside a fragment (not an activty) :

    mViewPager.setAdapter(new MyFragmentStatePagerAdapter(getChildFragmentManager()));

提交回复
热议问题