Abhinash Singh
Abhinash Singh

Reputation: 1

How to call another navgraph fragment from another nav graph without lossing current destination in andorid

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

Answers (1)

Yash Shah
Yash Shah

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

Related Questions