Android Fragment (ii)

Source: Internet
Author: User

How do I use fragment?

1. First you need to determine how many fragment you want to use in an activity.

2. Create a class that inherits from fragment based on the number of fragment you have. Then rewrite some methods according to the actual requirements.

3. For each fragment, create the appropriate layout XML file.

4. Finally, modify your activity file according to your needs and create a practical logic method for switching fragment.

What type of fragment?

1. Separate frame fragment-----separate frame fragment is used to handle handheld devices, like mobile phones, we only display a frament.

2.list fragment----Fragment has a special list view called List fragment.

3.fragment transaction----Using this thing, we were able to move one fragment to another.


Android Fragment (ii)

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.