FragmentPagerAdapter inside Fragment

拈花ヽ惹草 提交于 2019-12-04 03:58:42
blinkmacalahan

This question is a possible duplicate of Navigating back to FragmentPagerAdapter -> fragments are empty.

If your app can handle it (API 17), use getChildFragmentManager(). This problem seems to occur when using a Fragment to host your ViewPager and using FragmentPagerAdapter. Changing to FragmentStatePagerAdapter seemed to fix the problem as well, but I still think using getChildFragmentManager() is the smartest thing to do.

brockoli you can used not "good way". But for my it's worked.

You can use in view 2 layouts, where you bind fragments. First - for fragment with fragments. Second - for other fragments.

On replace fragment with fragments do not replace, but only change visibility first layout to gone and add new fragment to second layout. On back, remove fragment from second layout and set visibility for first layout to visible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!