How to resume activity instead of restart when going “up” from action bar

左心房为你撑大大i 提交于 2019-12-02 17:02:21
singularhum

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);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!