How to Use the DialogFragment and Activity-managed Dialog,

Source: Internet
Author: User

How to Use the DialogFragment and Activity-managed Dialog,

1. Use of the Dialog managed in the Activity: This describes how to use the Dialog managed in the Activity. Create a Dialog box by rewriting onCreateDialog, however, this method is no longer used, and the api says this method has been replaced by DialogFragment. I came into contact with this method because I saw a project with an animation loading instance. Later I checked the api and started to understand DialogFragment.

2. Here we use AlertDialog to create links to various dialogs: There are only some instances and there is no detailed explanation. However, after reading the code, we can find that there is nothing to detail.

3. simple use of DialogFragment: I have learned from this that there are two implementation methods in DialogFragment: onCreateDialog () method or onCreateView () method. Both methods are used when the dialog box is created for the first time. In the API, I learned that the onCreateDialog () method is suitable for directly using AlertDialog to create a dialog box, while the onCreateView () method is suitable for customizing the layout to implement the dialog box.

? This is not detailed, but it is sufficient to understand it. My problem has not been solved yet. The instance I see is used in the Activity to create a dialog box using the onCreateDialog () method. In the onPreparedDialog () method, it is actually a circle of images that keep rotating, the use of multithreading constantly changes the angle of view. Since DialogFragment can be used instead, I really don't know which method should be used to implement the content of onPreparedDialog. So I plan to find a ready-made instance to learn, and the use of the Animation object and the use of the rotate layout file are also very interesting. I plan to know about it recently.

I recently went home, had no network, and had not sorted it out for a long time. As there were more and more problems, I had to hurry up and I had no time to start school.

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.