I have 2 activities: Main and List.
From Main you can open List; from List you can open Main.
I’d like it so that every opening of List does not get saved into the ‘history’. So, pressing back from Main cannot return to List.
Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When starting your list’s
Activity, set itsIntentflags like so:The
FLAG_ACTIVITY_NO_HISTORYflag keeps the newActivityfrom being added to the history stack.NB: As @Sam points out, you can use
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);instead. There is no functional difference.