在 Android 上关闭应用程序并启动主屏幕 [英] Close application and launch home screen on Android

查看:26
本文介绍了在 Android 上关闭应用程序并启动主屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的活动.第一个启动第二个.在第二个活动中,我调用 System.exit(0) 以强制关闭应用程序,但第一个活动会自动显示,而不是应用程序返回主屏幕.如何避免这种情况,并使应用程序返回主屏幕?

I have two different activities. The first launches the second one. In the second activity, I call System.exit(0) in order to force the application to close, but the first activity is automatically displayed instead of the application returning to the home screen. How can I avoid this, and get the application to return to the home screen?

推荐答案

你真的应该考虑不退出应用程序.这不是 Android 应用通常的工作方式.

You should really think about not exiting the application. This is not how Android apps usually work.

这篇关于在 Android 上关闭应用程序并启动主屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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