Yusuf Ibragimov
04/21/2025, 6:02 AMPablichjenkov
04/21/2025, 6:18 AMYusuf Ibragimov
04/21/2025, 6:22 AMStylianos Gakis
04/21/2025, 6:29 AMnavController.navigate(YourScreen(params)) { popUpTo(YourScreen) { inclusive = true} }
Yusuf Ibragimov
04/21/2025, 6:40 AMPablichjenkov
04/21/2025, 6:48 AMYusuf Ibragimov
04/21/2025, 9:55 AMsindrenm
04/21/2025, 10:46 AMSavedStateHandle
. Something like this:
val handle = navController.previousBackStackEntry?.savedStateHandle
handle["result-key"] = "Result Value"
Then, in the destination for the screen you're going back to, you would want to observe changes to the `SavedStateHandle`:
composable<ScreenYouPoppedBackTo>() { backStackEntry ->
val result = backStackEntry.savedStateHandle
.getStateFlow<String?>("result-key", initialValue = null)
.collectAsState()
}
Jan Skrasek
04/22/2025, 9:57 AM