如何杀死我的Andr​​oid应用程序? [英] How to kill my application in android?

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

问题描述

我的工作已经注销按钮android应用。当我点击,我需要完全关闭我的应用程序(我不想在后台运行应用程序以及)。可否请你指点我如何才能做到这一点。我试着用 System.exit(0)完成()以及

I am working on a android application which has logout button. When I click on that I need to close my app completely (I don't want to run the app in background as well). Could you please advice me how can I achieve this. I tried with System.exit(0) and finish() as well.

推荐答案

在您的注销按钮试试这个code:

on your logout button try this code:

 finish();
 moveTaskToBack(true);
 System.exit(0);

我认为这不会完全关闭应用,但会从所有活动的退出。

i think this will not close your app completely but will exit from all of the activities.

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

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