I’ve got an application that launches an introduction flow on first run like this:
ON FIRST RUN
A: Intro text
B: Terms and conditions
C: Choose language
After all these steps have been completed, the application sets a first_run attribute to false and launches activity D.
Now, what I want to do is either clear the activity stack so that when the user presses the back button it goes back to the Home screen rather than activity C and then when the application launches again it goes straight to activity D.
Any ideas on how I would go about doing this?
EDIT
I’m aware that calling finish() on each activity removes it from the stack. But my real problem is that if the user wants to go back from B to A it won’t work if I’ve already called finish() on A. Sorry for not specifying this earlier.
This is gonna work for sure, apologies for the last post.
I realised it later that it wont work.
In Activity A, B and C use:
In onCreate of these activities, add:
In activity D, where you wanna finish all this: