如何关闭一个Android应用程序? [英] How to shutdown an android application?

查看:162
本文介绍了如何关闭一个Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何关闭一个Android应用程序?我没有找到一个shutdown命令的应用对象。
我想关机和重启在一些关键的错误的情况下。

How to shutdown an android application? I don't find a shutdown command to application object. I want to shutdown and restart in case of some critical error.

推荐答案

如果有某种严重错误,那么你应该要对付它在你的code而不是试图重新启动应用程序。

If there is some kind of "critical error", then you should should deal with it in your code rather then trying to restart the application.

您无法在关机的Andr​​oid应用程序,但是你的活动一度全部关闭(你可以用编程的Activity.finish()方法一样),那么你的应用程序被认为是关闭的。

You cannot shutdown an application in Android, however once all of your Activities are closed (which you can programatically do with the Activity.finish() method), then your application is considered to be closed.

这篇关于如何关闭一个Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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