allan.conda
11/04/2021, 1:16 PMallan.conda
11/04/2021, 1:19 PMNavHost(
...,
route = "navHost",
startDestination = "a/{x}?{y}={y}",
) {
composable(
"a/{x}?y={y}",
arguments = listOf(
navArgument("y") { type = NavType.Long }
)
) {
}
composable("b") {
}
}
navController.navigate("b")
Ian Lake
11/04/2021, 2:32 PMx
is optional, it should be a query parameter (i.e., argName={x}
) otherwise it sounds like you should be adding a defaultValue
to your navArgument
allan.conda
11/04/2021, 3:29 PMdefaultValue
could be an option. Is there a way to specify a specific value to it when navigating to a non-start-destination? For example I want to go to b
and when pressing back, I expect destination a/x_value
But I’m getting the issue on the optional {y}
actually, I get a “cannot cast null as Long”.
Is it a bug?Ian Lake
11/04/2021, 4:57 PM{y}={y}
doesn't make any sense, FWIW - it should be y={y}
if anything