Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add (not replace) fragment with navigation architecture component

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?

like image 682
mohamed Shater Avatar asked Oct 09 '18 08:10

mohamed Shater


1 Answers

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"

like image 180
utkukutlu Avatar answered Oct 06 '22 16:10

utkukutlu