当从活动中调用时,不希望刷新tabsactivity。[英] Don't want to refresh tabsactivity when call from activity android

本文是小编为大家收集整理的关于当从活动中调用时,不希望刷新tabsactivity。的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我试图停止刷新我的选项卡活动,在下面的图片中,您可以看到我从选项卡片段启动新活动,然后通过按下返回按钮并返回选项卡的活动将其关闭,所有选项卡都将重新启动.我需要以某种方式恢复标签活动,

在下面的代码中,我称为新活动:

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

并以这种方式关闭它:

finish();

这里我的所有通话活动和tabsactivity的流程'> </a> </p>
<h2 style=推荐答案

而不是完成,就像这样使用标志

Intent intent = new Intent(current_context, destination_activity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

本文地址:https://www.itbaoku.cn/post/2091076.html

问题描述

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

推荐答案

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);