Hey all! I'm using navigation compose and have an app where the user should see the login screen on ...
e
Hey all! I'm using navigation compose and have an app where the user should see the login screen on first launch. Following the recommendations of conditional navigation, I have the Home screen as the start destination of the NavHost and then the Login screen is added to the stack if the user is not Logged In. This means that I need to have a
BackHandler
within that Login screen to close the app if the user presses back, to prevent them navigating "back" to the Home screen. The issue with this approach however is that this breaks the predictive back gesture. Has anyone have a fix for this issue? (cc: @Ian Lake)
d
Use save and restore state (i.e. like multi backstack bottom nav) so your graph contains only the login screen when you navigate to it