在最大限度地减少我的应用程序,然后再次打开它为何我的应用程序再次启动画面开始? [英] On minimizing my app and opening it again why is my app starting from the Splash screen again?

查看:104
本文介绍了在最大限度地减少我的应用程序,然后再次打开它为何我的应用程序再次启动画面开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从闪屏导航到另一个活动后,我的申请,我用$ P $最小化pssing Home键,然后再次打开我的应用程序,而不是开放的,我在上次的活动,它从开始闪屏了。

In my application after navigating from the Splash screen to another activity, I minimize it by pressing the Home button and then open my application again and instead of opening from the activity that I was last in, it starts from the Splash screen again.

你能告诉我为什么会这样?

Can you please tell me why this is happening?

推荐答案

在你的情况下,安装应用程序,如果你preSS的打开按钮后,您的活动将是带到前面没有创建。请粘贴下面的code在第一个活动并对其进行测试。这对我的作品。

In your scenario,after installing the application,if you press the OPEN button the your activity will be brought to front not created. Please paste the following code in your first activity and test it. It works for me.

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
    // Here activity is brought to front, not created,
    // so finishing this will get you to the last viewed activity
    finish();
    return;
  }
}

这篇关于在最大限度地减少我的应用程序,然后再次打开它为何我的应用程序再次启动画面开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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