简体   繁体   English

登录活动被杀死并按下主页按钮后,如何使主页活动可见

[英]how to make home activity visible after login activity kill and home button pressed

After successful login the Login activity launched the second activity. 成功登录后,“登录”活动启动了第二个活动。 I want my first activity(Login activity) not to be shown after successful login, for that i called finish() method after login But after the home button pressed, instead of home button again the login activity recreated.?But i expected the home activity to be shown when task again started from recent app list, instead of the login activity. 我希望在成功登录后不显示我的第一个活动(登录活动),为此我在登录后调用了finish()方法,但是在按下主页按钮之后,而不是再次按下主页按钮,重新创建了登录活动。当任务从最近的应用程序列表再次开始时显示的活动,而不是登录活动。

Giving the reference of two exact questions App always starts fresh from root activity instead of resuming background state (Known Bug) and How to return to the latest launched activity when re-launching application after pressing HOME? 提供两个确切的问题的参考App总是从root活动重新开始,而不是恢复后台状态(已知错误),并且按HOME后重新启动应用程序时如何返回到最新启动的活动?

Here is what one of the answers have mentioned: 这是提到的答案之一:

This is due to the intents being used to start the app being different. 这是由于用于启动应用程序的意图不同。 Eclipse starts an app using an intent with no action and no category. Eclipse使用没有动作且没有类别的意图来启动应用程序。 The Launcher starts an app using an intent with android.intent.action.MAIN action and android.intent.category.LAUNCHER category. 启动器使用具有android.intent.action.MAIN操作和android.intent.category.LAUNCHER类别的意图启动应用。 The installer starts an app with the android.intent.action.MAIN action and no category. 安装程序使用android.intent.action.MAIN操作且没有类别启动应用程序。

Hope it helps. 希望能帮助到你。 For more you may read the other two questions. 有关更多信息,您可以阅读其他两个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM