Add (not replace) fragment with navigation architecture component

mohamed Shater picture mohamed Shater · Oct 9, 2018 · Viewed 9.9k times · Source

I have an activity with a product list fragment and many other fragments and I am trying to use architecture component navigation controller.

The problem is: it replaces the (start destination) product list fragment and I don't want the list to be reloaded when user click back button.

How to make the fragment transaction as add not replace?

Answer

utkukutlu picture utkukutlu · Dec 30, 2019

Android navigation component just replace but you want to add fragment instead of replace like dialog you can use this but need to min. "Version 2.1.0" for navigation component.

Solution

and you can see "Dialog destinations"