Why Compose Navigation with a dialog end point beh...
# compose-android
b
Why Compose Navigation with a dialog end point behave differently from composable? I would expect that if I have a dialog target that if you view the recents list in Android and come back to the app (without actually backgrounding), that the dialog endpoint would not be called again. I created a example based off of the navigation codelab (link) Here is the pertinent code:
Copy code
composable(route = Bills.route) {
            println("prizzy vb>>")
            BillsScreen()
        }
        composable(
            route = SingleAccount.routeWithArgs,
            arguments = SingleAccount.arguments,
            deepLinks = SingleAccount.deepLinks
        ) { navBackStackEntry ->
            val accountType =
                navBackStackEntry.arguments?.getString(SingleAccount.accountTypeArg)
            SingleAccountScreen(accountType)
        }
        dialog(route = Dialog.route){
            println("prizzy dizzy >>")
            DialogDemo()
        }
So if I am on the Bills route and if I background and restore it "prizzy vb" isn't called again If I do it on the Dialog.route "prizzy dizzy" is printed in logcat when the app is restored, causing the dialog to lose state that is remember'ed