How can I send `surveyToken` here to ResultScreen?...
# android
c
How can I send
surveyToken
here to ResultScreen?
Copy code
surveyScreen(
    moveToResult = { surveyToken ->
        navController.navigateToResult(surveyToken)
    }
)
And here's the navigateToResult function.
Copy code
const val resultRoute = "result_route"

fun NavController.navigateToResult(surveyToken: String, navOptions: NavOptions? = null) {
    this.navigate("$resultRoute/$SURVEY_TOKEN?=$surveyToken", navOptions)
}

@OptIn(ExperimentalAnimationApi::class)
fun NavGraphBuilder.resultScreen(deviceDisplayState: DeviceDisplayState, moveToOrder: () -> Unit, moveToBack: () -> Unit) {
    composable(route = resultRoute) {
        ResultRoute(deviceDisplayState, moveToOrder, moveToBack, hiltViewModel(LocalContext.current as MainActivity))
    }
}
I get
Copy code
java.lang.IllegalArgumentException: Navigation destination that matches request NavDeepLinkRequest{ uri=<android-app://androidx.navigation/result_route/survey_token?=711d28d33d0fd880459108da5aeb819fce94948f49bdbed20117a27c7109> } cannot be found in the navigation graph NavGraph(0x0) startDestination={NavGraph(0x22fb6594) route=entry_graph startDestination={Destination(0x2395568f) route=entry_route}}
this error.
d
Copy code
this.navigate("$resultRoute/$surveyToken", navOptions)
Try this