I'm creating a shopping application using Navigation Component(NavHost with BottomNavigationView)
The app has two tabs(Tab Home & Tab Categories). From Tab Home, the user can select a product and see the product detail and from Tab Categories, the user can navigate through categories. Now when the user opens a product from Tab Home, then if he/she selects Tab Category and then he/she selects Tab Home again, the Home destination will show but I want to show product destination and when the user clicks on back button show him/her home destination.
I've read these questions(Question 1 , Question2) but they don't use NavHost. I want to know is there any simpler or automatic way to accomplish this in NavHost?
Asked
Active
Viewed 529 times
0

hosseinAmini
- 2,184
- 2
- 20
- 46
-
it a bit unclear – John Joe May 17 '19 at 07:56
-
@John Joe I want to do something like this with NavHost https://stackoverflow.com/questions/45611300/separate-back-stack-for-each-tab-in-bottomnavigationview-android-using-fragments – hosseinAmini May 17 '19 at 08:10
-
@hosseinAmini chack this question https://stackoverflow.com/questions/42362917/fragment-re-created-on-bottom-navigation-view-item-selected – Dulanga May 17 '19 at 08:13