Android trick 9: About the redundant "exit" function in the android program...

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.