IllegalStateException: is not currently in the FragmentManager

后端 未结 12 2110
予麋鹿
予麋鹿 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

    Fragments in the ViewPager are fixed, instead of trying to replace the fragments in the adapter, try to give a different set of fragments and notifyDataSet changed, or take the advantage of FrameLayout to show another fragment over the view pager tab's current fragment.

    There is my solution that works:

    Swipe Gesture applied at Fragment level along with ViewPager with it's default swipe disabled

提交回复
热议问题