Open mohammadrezas4 opened 5 years ago
Running into this same issue. It looks like in this scenario, the FragmentManager
still has a reference to all the Fragment
s in the ViewPager
, even though getItem
on the ViewPager
's FragmentPagerAdapter
isn't called besides the first time. I'm guessing the view for these Fragment
s have been destroyed, but since the FragmentManager
still knows about them, they are not getting onViewCreated
called, and thus you don't see them.
I'll report back if I get anywhere with this
@mohammadrezas4 try adding this line when you initialize your FragNavController
fragmentHideStrategy = FragNavController.DETACH_ON_NAVIGATE_HIDE_ON_SWITCH
@mohammadrezas4
I have the same issue and resolved the issue by doing the following method.
Please pass getChildFragmentManager() to the ViewPagedAdapter.
new ViewPagerAdapter(getChildFragmentManager());
@inv-jithin yes you are absolutely right brother. Thanks for the help.
hi. I have a problem with it. I'm new in android and I have 3 tabs in a BottomBar in my App. one of them has a view pager that scroll between 5 or 6 fragment in it. in the first lunch everything is ok but when I switched between tabs and back to the tab has view pager it shows nothing. view pager is loaded but fragments in it didn't load. what can I do ?