Reputation: 1
I have Two navgraph inside my project
Scenario { once user get logged In successfully I want to navigate user to -> graphB(Profile Page) but once user press back button he go back to Graph B (Home Fragment) }
Upvotes: 0
Views: 537
Reputation: 60
In logged successfully response you redirect your fragment to profile page
findNavController(R.id.nav_host_fragment).navigate(R.id.navigation_profile_page)
and on back button redirect the home fragment
findNavController(R.id.nav_host_fragment).navigate(R.id.navigation_home)
Upvotes: 0