Android Jetpack Navigation with ViewPager and TabLayout

前端 未结 5 813
面向向阳花
面向向阳花 2020-12-13 10:09

For a new app i use Jetpack Navigation Library to implement proper back navigation. The first level of navigation is a navigation drawer which works fine with jetpack naviga

5条回答
  •  悲&欢浪女
    2020-12-13 10:21

    This worked for me. I added the viewPagerTabs fragment to nested graph like so:

    
            
                
            
    
    

    and then inside the child fragment of the viewpager:

    val action = TabsFragmentDirections.actionNavTabsToNavSend()
    findNavController().navigate(action)
    

提交回复
热议问题