Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Vote: I am impacted
Notification menu
Unintended behavior
View staffing
Description
#1Component used: Navigation Compose
Version used: 2.4.0-alpha05
Devices/Android versions reproduced on: Pixel 5, SDK 31
I have an
Activity
which displays a screen with a button (ComposableA
) and when I tap on the button, I want to display another screen (ComposableB
). When I tap back onComposableB
, I don't want to go back to theComposableA
, instead I want to close the app.My understanding was that I could do it like this:
When I tap the button,
ComposableB
appears for a brief moment, but then the app crashes with the following stack trace (see below). When I remove theinclusive = true
(or when I set it tofalse
) the app doesn't crash, but then tapping the phone's back button takes me back toComposableA
. I don't want – I want the app to close when I tap back. Think ofComposableA
as just a login screen.I can't figure out what am I doing wrong. I was following this documentation . I feel like this could be a bug in Navigation or Compose.
These are my build.gradle files, if that helps: