My app uses navigation component, I have CreditFragment
and it uses TabLayout
with ViewPager2
, it contains CreditTabFragment
, when I am at the CreditTabFragment
I want to navigate to NeedHelpFragment
using findNavController()
.
How can I make the Navigation Controller know I'm on creditTabFragment
?
I tried to create a childFragmentManager
but without success
ClickListener of the button that navigates to NeedHelpFragment
I Used child fragment manager where i set my view pager adapter:
viewPager.adapter = SectionsPageAdapter(childFragmentManager, lifecycle)
With this you will be able to use navigation, note: the navigations must be in the father fragment, not in the tabs layouts.