I have a an app that starts with a MapActivity showing some POI’s on the map. There is a button to take you to a list of the POI’s. In the ListActivity there is a button to take you to the map. If you start the app and click the “List” button and then the “Map” button, then the “List” button, then the “Map” button, etc. Then you have to back out past all of those Activities in order to get to the Home screen again. I have both activities defined as android:launchMode="singleTop" and I use startActivityIfNeeded(intent, 0); in the OnClickListener. Is there a way around this?
I have a an app that starts with a MapActivity showing some POI’s on
Share
Given Activity A and B, where A always calls B and B always calls A:
Try calling
finish()instead of starting A from B – which is whatonBackPressedis doing.