android / architecture-components-samples

Samples for Android Architecture Components.
https://d.android.com/arch
Apache License 2.0
23.4k stars 8.29k forks source link

How to set middle item as first in Navigation Advanced Sample #1009

Open marius-zilinskas opened 3 years ago

marius-zilinskas commented 3 years ago

Question about Navigation Advanced Sample

In the example the most left menu item is the main one - if user clicks on other menu items and then presses back button - user will be navigated back to left menu item and after pressing back again - activity will be finished.

My question is: if there are 3 menu items, how to make the middle item behave as the left one. In other words, how to make middle menu item the "fixed start destination", or the "main menu item"?

LivingWithHippos commented 3 years ago

In the main nav graph there's an app:startDestination="@+id/home" option I think that could be it