If you want to completely kill your application, rather than just finish the activity then either of the above snippets will do.
Thanks to sammyF on #android for the second way, which is shorter but probably less of an official way to do it.
/* Way one */
android.os.Process.killProcess(android.os.Process.myPid())
/* Way Two */
System.exit(0);
5 Comments
you will find core android developers on the google group deriding this sort of process murder. just use finish(). see here http://markmail.org/message/ni2vh4ckeqax7q5c#query:related%3Ani2vh4ckeqax7q5c+page:1+mid:ni2vh4ckeqax7q5c+state:results
You can use another way: ActivityManager.restartPackage(packageName);
That's way 3:)
How to kill others Application?
"How to kill others Application?"
Answer: ActivityManager.restartPackage(packageName);
Thanks for sharing!
DON'T KILL ME
Thanks for sharing!