Justin Tarnoff
12/27/2022, 9:58 PMActivityNavigatorDestinationBuilder
, I'm able to access the action, data, and dataPattern used to create the intent, but I don't see a way to let me set flags like FLAG_ACTIVITY_NEW_TASK
or FLAG_ACTIVITY_CLEAR_TOP
. How can I navigate back to Activity 0 and clear the back stack?Justin Tarnoff
12/27/2022, 9:59 PMfun NavGraphBuilder.generateNavGraphFlow2(navController: NavHostController) {
composable(NavRoutes.Flow2Screen6.route) {
Flow2Screen6(
onNavigateToFlow2Screen7 = { navController.navigate(NavRoutes.Flow2Screen7.route) }
)
}
composable(NavRoutes.Flow2Screen7.route) {
Flow2Screen7(
onNavigateToHome = {
navController.navigate(NavRoutes.Home.route)
}
)
}
activity(NavRoutes.Home.route) {
this.activityClass = ActivityZero::class
}
}
Ian Lake
12/27/2022, 11:20 PMActivityNavigator.Extras
instance: https://developer.android.com/reference/androidx/navigation/ActivityNavigator.ExtrasIan Lake
12/27/2022, 11:21 PMIan Lake
12/27/2022, 11:21 PMIan Lake
12/27/2022, 11:25 PMnavController.navigate(
NavRoutes.Home.route,
null, // no NavOptions
ActivityNavigatorExtras(flags= Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK))
)
Ian Lake
12/28/2022, 6:36 AMnavController.navigate(
NavRoutes.Home.route,
null, // no NavOptions
ActivityNavigatorExtras(
)
Justin Tarnoff
12/29/2022, 3:36 PM