Android Learning Record-Fragment

Source: Internet
Author: User
What is 1,fragment? Fragment is an interface layout unit that is smaller than the activity granularity, and each fragment contains its own set of UI components, which can be seen as a miniature version of activity, each activity containing one or more fragment, 2, why do I need fragment? (meaning, function, etc.) the introduction of fragment is for the large screen of the tablet, but after the 4.0 version with the mobile phone is unified, that is, the mobile phone can also use the fragment.    When an activity is split into multiple fragment, each fragment manages its own set of UI components, fragment can be dynamically combined, allowing the activity to be more flexible in interface layout 3, compared to activity? Relationship: Fragment is a smaller version of activity, one activity contains one or more fragment, each fragment embedded in an activity, fragment can be freely and dynamically combined, Can be considered a smaller than the activity granularity of the interface layout Unit difference: When the activity enters the background, it is put into the fallback stack, when the user presses the Back button, the activity can be resumed, but the fragment will not be automatically placed in the fallback stack when it enters the background.    Need to explicitly call the life cycle of the Addtobackstack () method 4,fragment? Fragment experience is similar to activity, but some of the new states are fragment alone

Android Learning Record-Fragment

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.