Android Development dialog Box dialog the difference between the dismiss and hide methods

Source: Internet
Author: User

http://ningtukun.blog.163.com/blog/static/186541445201310151539697/

Both the dismiss and hide methods can hide the dialog box and can be displayed with the Show method call when needed. However, there is a difference between the two.

The dismiss method frees the resources that the dialog box occupies, and the Hide method does not. You must call the dismiss method to close the dialog box before the activity exits.
If there is a ProgressBar on the dialog, you will find that after calling the dismiss method, call the Show method, the dialog box, the above ProgressBar no longer rotates, and the Hide method is called no problem.
Therefore, the most correct method of invocation is to call the dismiss method in the Ondestory method of the activity, and hide the dialog box in other places with the Hide method.

Android Development dialog Box dialog the difference between the dismiss and hide methods

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.