How to clear back stack of Multiple Navigation graph in android?

Viewed 437

I have implemented the multiple nav graph using bottom navigation like below. enter image description here

What is happening here is when i go to page number 1 on homeFragment and then navigate to dashboard through bottom navigation after that when i return to home it opens page number 1 on homeFragment.

Instead, I want to do is when coming to homeFragment from dashboard or notification then starting fragment will open not page number 1

2 Answers

you can use this for explicit pop or this general pop can be used as well.(Also, make sure that you do not open page number1 manually.try to implement that with navigation components. )

Check your menu.xml and remove below from menu items

android:menuCategory="secondary"

Related