恢复活动的Andr​​oid [英] Resume activity in Android

查看:124
本文介绍了恢复活动的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3项活动的应用程序。

我的主要活动。这就要求第二次活动,然后调用第三个活动。我想返回到主活动不进入的onCreate。

这是在code的第三个活动:

  startActivity(新意图(TerceraActiviry.this,Main.class));
 

解决方案

如果你的活动仍然在运行此code将把它带到前面,而无需输入的onCreate。

 意图openMainActivity =新的意图(TerceraActiviry.this,Main.class));
        openMainActivity.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(openMainActivity);
 

希望这有助于!

I have an app with 3 activities.

I have the main activity. This calls the second activity, which then calls the third activity. I want return to the main activity without entering the onCreate.

This is the code for the third activity:

startActivity(new Intent(TerceraActiviry.this, Main.class));

解决方案

If your activity is still running this code will bring it to the front without entering onCreate.

        Intent openMainActivity= new Intent(TerceraActiviry.this, Main.class));
        openMainActivity.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(openMainActivity);

Hope this helps!!

这篇关于恢复活动的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆