I've very little knowledge about all this codes, but I'm building an application, and I want to kill the application onPause. Please give me a code by which I can kill the application.
Asked
Active
Viewed 1,020 times
0
-
7I'M SORRY, I CAN'T HEAR WHAT YOU'RE SAYING. WHAT IS THIS TALK OF KILLING?! KILLING IS BAD! No, seriously - it is. – Codemonkey Apr 28 '11 at 08:22
-
The question is perfectly clear even if it was originally written in capitals. The questioner wants to know how to code an Android application to exit when it receives a pause event. – richj Apr 28 '11 at 08:36
-
2Yeah, sorry, rich. I was not serious and I was trying to make a sarcastic response that also played a little on the concept that completely killing an Android application is bad form. – Codemonkey Apr 28 '11 at 08:39
-
1Hi Klaus. My comment was intended to justify my reopen vote. This looks like a real programming question that could have been (and was) reasonably answered in its original form. I have no problem with jokes in comments, non-native English speakers, or text entered without a standard keyboard. – richj Apr 28 '11 at 09:08
-
to my knowledge ALL CAPS is used to express your anger on screen.. better avoid it user728859 – Jana Apr 28 '11 at 11:00
2 Answers
1
Please don't use all caps.
... onPause(){
finish();
}
You shouldn't use System.exit(0); but since your question is in all caps you probably will.
Other ways to exit app and reason to not use System.exit:
-
1
-
thank you. and next time i'm surely not gonna use caps, but, wasn't aware of the fact that it can turn into something else...lol.. – user728859 Apr 30 '11 at 05:04
1
If you want to exit the application then use System.exit in over ridden onPause method

Rasel
- 15,499
- 6
- 40
- 50