I am building an app that requires the user to login to get access to their information. Within the app there are four branches all accessible via menu options. When the user logs in he is placed on the first screen of one of the branches.
I programmed the app so that when the user BACKs to the first screen of any branch, the activity stack is flushed and pressing back again exits the app.
The question: What is the best practice for exiting?
- Should pressing back a second time log the user out and return to the login screen.
- Or should pressing back log the user out and return the user to the android home screen?
I have seen both ways of doing it and not sure what criteria I should look at to make the proper usability decision.
To clarify the flow:
[Android Home Screen] -> [App Login Screen] -> [Internal App Branch]
I usually capture the Back button, give the user a Toast notification like “Press Back button again to exit”. I capture the System.currentTimeMillis and compare subsequent presses for a threshold of 2 seconds or something close to that. I’ve seen a couple apps do that and it seems pretty intuitive to me.