I have two activities. Say Activity A
and Activity B
.
From Activity A
I click a button to launch Activity B
Should've added as an answer instead of a comment.. but here you go so you can accept if you want so others can see if necessary.
https://stackoverflow.com/a/16147110/3286163
Basically, to summarize the android will always recreate the activity unless you specify it not to with
android:launchMode="singleTop"
Note: it will not work if the returning activity is not on the top of the back stack as mentioned in the reference.
For anyone else, please upvote the answer in the url instead of mine if you find this useful.
You can also achieve the same outcome programatically
Intent upIntent = NavUtils.getParentActivityIntent(this);
upIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NavUtils.navigateUpTo(this, upIntent);