Android Fragment (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"

So your app is not compatible with apps under 3.0.

can use the <fragment> label, this is very important, if the use of android.support.v4.app.Fragment words, is not to use the <fragment> tag, Will throw android.view.InflateException:Binary XML file line #7: Error inflating class fragment exception

(2) Android.support.v4.app.Fragment: can be compatible to 1.6 version, cannot use <fragment> tag, need to be added in the program by add or replace, but also need

Android-support-v4.jar

Fragment the use of tutorials please refer to the official website of the demo, that is, android.app.Fragment as an example, you can use the Getfragmentmanager (), activity of a method,

If you use android.support.v4.app.Fragment, you need to inherit fragmentactivity and use Getsupportfragmentmanager, both of which are designed to

Get Fragmentmanager, name the same but the package name is not the same.

Android Fragment (Android.support.v4.app.Fragment and Android.app.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.