There are variousArticleTeach you howProgramThe android. OS method, restartpackage method, and system. Exit method are executed on any page of the program. Some people may even fear how to exit the program due to manufacturing exceptions.
As a matter of fact, based on the android model, we really need this function: Can users see a button to exit the application at any time?
I don't think so. Google officials have long expressed this point of view:
Question:Does the user have a choice to kill the application
Unless we put a menu option in to kill it? If no such option exists,
How does the user terminate the application?
Answert (Romain guy ):The user doesn' t, the system handles this
Automatically. That's what the activity lifecycle (especially
Onpause/onstop/ondestroy) is for. No matter what you do, do not put
"Quit" or "exit" application button. It is useless with Android's
Application model. This is also contrary to how core applications work.
Let the android framework (activity lifecycle) automatically manage application life and death, I think there will be errors and exceptions in the past or in the future, and this function cannot be completed. Do not appear on the menu.
Reference: http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238#2034238