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?
Asked
Active
Viewed 2,403 times
0

Michael Petrotta
- 59,888
- 27
- 145
- 179

sachi
- 479
- 1
- 10
- 25
-
Don't bother. Android will automatically kill it when necessary. – ceejayoz Oct 03 '11 at 05:26
-
Android destroy's your application itself. No need to force destroy the application. – evilone Oct 03 '11 at 05:27
3 Answers
1
Android does not destroy applications unless it needs to. See this answer for more details: Is quitting an application frowned upon?

Community
- 1
- 1

spatulamania
- 6,613
- 2
- 30
- 26
1
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.

rDroid
- 4,875
- 3
- 25
- 30
0
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.

ngesh
- 13,398
- 4
- 44
- 60