Android应用程序没有关闭 [英] Android app doesn't close

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

问题描述

有在我的应用程序的一个点,我需要彻底杀灭应用。我用这个来完成:

There is a point in my app where I need to kill the app completely. I use this to do so:

protected void exitApp()
{
    Dialogs.DismissAll();
    finish();
    int pid = android.os.Process.myPid(); 
    android.os.Process.killProcess(pid); 
}

我的问题是,这只是作品有时。在其他时候,这时候被调用设备屏幕只是变黑,不进入设备的主屏幕。要进入主屏幕从这一点上,我不得不preSS的主页按钮。任何想法,为什么?

My problem is that this only works sometimes. At other times when this gets called the device screen just turns black and doesn't go to the device home screen. To get to the home screen from this point I have to press the home button. Any ideas why?

(请不要训斥我这个code是如何针对Android开发的指导方针。我读过关于它的所有信息,并认为这是最好的办法给他们想要的客户端)

(please don't lecture me about how this code is against Android development guidelines. I have read all the information about it and feel that this is the best approach to give the client what they want)

感谢

推荐答案

你检查,在堆叠中的所有活动都被破坏掉了?

Did you check that all activites in the stack are getting destroyed??

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

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