So I have an app that has the following layout
Activity -> ViewPager -> FragmentA -> FragmentContainerView -> FragmentB
FragmentContainerView contains a NavHostFragment, which displays FragmentB using a nav_graph. There is a button in FragmentB that navigates to a new instance of FragmentB. So the Nav graph is basically just one fragment that has a link to itself.
Now if I have the FragmentContainerView directly in my activity, this works fine. However, if I put the FragmentContainerView inside another fragment inside a ViewPager, the back button no longer allows me to navigate the FragmentB navgraph.
I am using app:defaultNavHost="true" on the FragmentContainerView, but it doesnt help.
Any idea what I'm doing wrong, and what could I do to fix it?