Jetpack Compose AnimatedNavHost Close issue

Viewed 120

I am trying to replace the NavHost with AnimatedNavHost, but having an issue. Using NavHost I have this structure:

@Composable
fun AppNavHost(...){
    val navController = rememberNavController()
    NavHost(navController = navController, ...) {
        composable("1") { Screen1() }
        composable("2") { Feature1NavHost() }
    }
}

In Feature1NavHost, I have another NavHost that takes control of the feature navigation. So, Screen-1 calls “2” and pops out of the stack. Everything works fine here. Using AnimatedNavHost, when I press back in the first screen of Feature1NavHost, the display blinks and the application does not close. I have to press a lot to close the app.

0 Answers
Related