I have a welcome screen containing two buttons:Login
and Sign Up
.
Hence I have a screen for each one: login screen
and sign up screen
.
Both of them are in the same NavGraphBuilder
. Users can navigate from sign up
screen to login
screen and vice versa.
At the moment, when the user is on the login screen and clicks on the signUp screen, the screen is added to backQueue
even though it already exists.
I try to prevent new destination recreation by applying singleTop
like this:
navController.navigate(AuthenticationNavGraph.SignInScreen.route) {
this.launchSingleTop = true
}
But no progress. So how can I prevent new screen recreation if the screen already exists on backQueue
?