如何在登录活动kill和按下主页按钮后显示主页活动

时间:2013-11-24 06:59:10

标签: android android-homebutton

成功登录后,Login活动启动了第二个活动。 我希望我的第一个活动(登录活动)在成功登录后不显示,因为我在登录后调用了finish()方法但是在按下主页按钮后,再次重新登录活动而不是主页按钮。但我预计到家当任务从最近的应用列表再次开始而不是登录活动时显示的活动。

1 个答案:

答案 0 :(得分:0)

提供两个确切问题的参考 App always starts fresh from root activity instead of resuming background state (Known Bug)How to return to the latest launched activity when re-launching application after pressing HOME?

以下是其中一个答案提到的内容:

  

这是因为用于启动应用程序的意图不同。 Eclipse使用没有操作且没有类别的intent启动应用程序。 Launcher使用android.intent.action.MAIN动作和android.intent.category.LAUNCHER类别的intent启动应用程序。安装程序使用android.intent.action.MAIN操作启动应用程序,没有类别。

希望它有所帮助。您可以阅读其他两个问题。