如何从Android应用程序退出? [英] How to exit from an android app?
本文介绍了如何从Android应用程序退出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚读到,你可以通过简单地调用退出Android应用程序:
I've just read that you can exit an android application by simply calling:
finish();
然而,这不是这种情况!当我这样做,我得到了以下错误:
However this is not the case! When I do this I get the following errors:
PackageInstallationReciever Remove /data/local/tmp/com._____.apk Fail!
AndroidRuntime Uncaught handler: thread main exiting due to uncaught exception
AndroidRuntime java.lang.NullPointerException
AndroidRuntime at android.....
dalvikvm Unable to open stack trace file '/data/anr/traces.txt': Permission denied
那么什么是强制应用程序退出的正确方法?为了记录在案,我是从一个菜单项调用它,但它似乎没有关系!
So what is the proper way to force an application to exit? For the record, I'm calling it from a menu item but it doesn't seem to matter!
推荐答案
您可能想看看<一个href=\"http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238\">Quitting一个应用程序 - 这是令人难以接受的线程在这里SO?
You might want to look at Quitting an application - is that frowned upon? thread here in SO.
这篇关于如何从Android应用程序退出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文