How to destroy my application?

回眸只為那壹抹淺笑 提交于 2019-12-24 23:11:07

问题


My application is always showing in Task Manager when I exit from my application. How do I destroy it? I used the onDestroy() method, but still it is running. I am using alarm manager and some database operations; is that the problem?


回答1:


Android does not destroy applications unless it needs to. See this answer for more details: Is quitting an application frowned upon?




回答2:


System.exit(0) will do the job. However, it is not at all recommended. Android does some caching, and saving state, so as to relaunch your appp quicker, the next time you launch it.. so you do not want to be messing around with that.




回答3:


Its not a problem. thats how android works, terminating Application is done by os. But if you want to kill it then you may have to kill the process.



来源:https://stackoverflow.com/questions/7631289/how-to-destroy-my-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!