I am have an Android app with 3 Activities.
The flow goes like this:
1____________click SignUp1____________Move to Act2
2____________click CreateAccount_____Move to Act3
What I want to know is when I got to Activity 3, how can I prevent user from going back to ALL the previous activities, not just the immediate previous one (activity2).
I have looked around and people have always recommended calling finish() after startActivity() in Activity2. But that won't work since android will direct user back to activity1.
In addition to that, in Activity1, I don't want to call finish() after startActivity() because I want to let users come back to Activity1 from Activity2 (say, they want to use SignUp2 instead).
To sum up, only when the user reaches Activity3, should they be prevented from going back to any other previous activities.
How do I achieve that?
Start your activity with these flags
(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK)