Don't want to refresh tabsactivity when call f

2019-08-11 12:42发布

I am trying to stop refreshing my tabs activity, in the below pictures, you can see when I start new activity from tab fragment and then close it by pressing back button and returning to the tabs activity, all tabs will be restarted. I need to somehow resume tabs activity,

In the codes below, I call new activity:

Intent i = new Intent(context, New_Activity.class);
startActivity(i); 

and close it in this way:

finish();

Here my all flow of calling activity and tabsactivity

1条回答
看我几分像从前
2楼-- · 2019-08-11 13:20

Instead of finish just use flag for it like this way

Intent intent = new Intent(current_context, destination_activity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
查看更多
登录 后发表回答