I’ve been having a problem with my app racking up different pages in the history. Basically there is only three layers to my app and just going in between the 1rst layer and the 2nd layer if you use the app for 5 mins will cause you to to press the back button 30 times to exit the app. I am currently using intents to change the class:
Intent filterIntent = new Intent(view.getContext(), NewLayer.class);
startActivityForResult(filterIntent, 0);
I basically just want the user to press the back button 3 or 4 times and be able to exit versus pressing back going back through their entire browsing history to exit. Sorry if this is confusing question but I don’t know how to properly phrase the question or the technical aspects of the issue to better reference what I mean.
When defining your intent, you might consider adding a flag to exclude the activity from being in the history.
There are other flags you might wish to add, such as FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS. The page I linked includes several you may wish to learn about.