Android fragment (difference between Android. Support. v4.app. fragment and Android. App. Fragment)

Source: Internet
Author: User

(1) Android. App. Fragment: the minimum compatible version is Android: minsdkversion = "11"

Therefore, your application is not compatible with applications under 3.0.

You can use the <fragment> label. This is very important if you use android. support. v4.app. fragment cannot use the <fragment> label, and Android is thrown. view. inflateexception: Binary XML file line #7: Error inflating class fragment exception

(2) Android. Support. v4.app. Fragment: compatible with version 1.6. The <fragment> label cannot be used.ProgramIn the Add or replace method, you also need

Android-support-v4.jar

For details about how to use fragment, refer to the demo on the official website. The example is Android. App. Fragment. You can use the getfragmentmanager () and activity method,

If Android. Support. v4.app. fragment is used, the fragmentactivity must be inherited and getsupportfragmentmanager must be used.

Get the fragmentmanager with the same name but different package names.

(1) Android. App. Fragment: the minimum compatible version is Android: minsdkversion = "11"

Therefore, your application is not compatible with applications under 3.0.

You can use the <fragment> label. This is very important if you use android. support. v4.app. fragment cannot use the <fragment> label, and Android is thrown. view. inflateexception: Binary XML file line #7: Error inflating class fragment exception

(2) Android. Support. v4.app. Fragment: compatible with version 1.6. The <fragment> label cannot be used. You need to add the <fragment> label in the program by adding or replace.

Android-support-v4.jar

For details about how to use fragment, refer to the demo on the official website. The example is Android. App. Fragment. You can use the getfragmentmanager () and activity method,

If Android. Support. v4.app. fragment is used, the fragmentactivity must be inherited and getsupportfragmentmanager must be used.

Get the fragmentmanager with the same name but different package names.

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.