I am using Jetpack Compose ui version 1.3.0-beta08
and navigation compose version 2.4.0-alpha02
and working Bloom app with all new Architecture components. After login success I need to clear all previous compose login screens, but even added popUpTo("HomeScreen"){inclusive = true}
, my login screen removed from backstack, but login welcome screen not removed from backstack, when I click back from Home screen. is it anything I am missing/wrong in compose navigation?
composable(Screen.LoginScreen.route) {
LoginScreen {
Log.d("AppMainNavigation", "AppMainNavigation: ${navController.backQueue}")
navController.navigate(Screen.HomeBaseScreen.route){
popUpTo(Screen.LoginScreen.route){
inclusive = true
}
launchSingleTop = true
}
}
}
GitHub Link : https://github.com/rramprasad/BloomApp/blob/main/app/src/main/java/dev/ramprasad/bloom/MainActivity.kt
popUpTo(0)
Pop up will try to pop all non-matching destinations from the back stack until this destination is found.0
id must not be in the backstack for this to work – Honghonied