Matti MK
07/05/2022, 6:17 PMnavigation(
route = "routeToNavigateTo",
startDestination = "startDestination/{argument}"
) {
composable(route = "startDestination/{argument}" ... ) { ... }
}
startDestination
.
Something like:
navigation(
route = "routeToNavigateTo/{argument}",
startDestination = "startDestination"
) {
composable(route = "startDestination" ... ) {
// get arg from navBackStackEntry here
}
}
Ian Lake
07/05/2022, 8:11 PMstartDestination/{argument}
destination, you never need to go through the graphMatti MK
07/06/2022, 4:49 AMnavigation(...)
) handle the startDestination
.Lasse Magnussen
02/01/2023, 12:39 PMcreateGraph
to create the graph, but my first destination wants data from the intent.
The graph is also reused elsewhere, nested in a different activity.
And I must admit; I don’t fully grasp what “directly navigate to your startDestination/{argument}
means — It makes sense to me for a nested nav graph where the entire graph starts off with some other start destination.
Trying to convert some XML nav graph to Kotlin…NavController.graph
- while this works there’s no way to pass in the startDestinationArgs
— these can, however, be supplied in NavController.setGraph
I simply passed along intent.extras
and everything worked like a charm…