Using Android's Navigation Component
, I have 3 fragments hosted by a single Activity. The launch fragment is a splash screen fragment (A), if the user is not logged in, I launch the login fragment (B), if they are logged in, I launch a list fragment (C).
So launch routes are either A->B->C or A->C.
When you land on B or C, pressing back should kill the app. The NavigationController though is instead backs up to A (I think, A's onActivityCreated
is certainly called at which point it crashes which is probably unrelated).
Pop behaviors in the graph editor for A -> B seem to allow me to pop to different fragments but there doesn't seem to be an option to just kill the app.
Do I really need to override onBackPressed
for this behavior and just kill the activity? Because this is easier without the NavigationController, usually I would just finish an activity as I start a new one.