Setup destinations

Back to the Navigation Editor, we now have a host in activity_main called mainNavFragment .

Click the add destination button to add fragments as destinations to the editor.

Navigation editor with destinations

The destination with little home icon means it’s the starting destination in the graph. To change it, select a destination and click the Set Start Destination button.

At that point, this is what the nav_graph.xml looks like:

nav_graph.xml

As you can see, the ids of my fragments are exactly the same as the bottom_nav.xml items ids.

bottom_navigation.xml