Skip to content Skip to sidebar Skip to footer

How Do I Link Multiple Activities In Android Navigation Editor?

I'm learning android development and the navigation component, trying to link multiple activities as the document had written. But it seems like it's impossible to create action be

Solution 1:

Since each NavController and navigation graph is contained within a single activity, an <activity> destination is an exit point from that graph - once you use navigate(R.id.your_activity_destination) to go to the next activity, that NavController and graph is no longer active (it is on the activity on the back stack, not the newly launched activity).

On your second Activity, you would have a second navigation graph with any additional <activity> outbound destinations to go to further activities.

Post a Comment for "How Do I Link Multiple Activities In Android Navigation Editor?"