My Android Learning experience 23

Source: Internet
Author: User

Problems encountered when learning fragment

These days learning fragment static loading when encountering this problem:

Java.lang.RuntimeException:Unable to start activity componentinfo{.... }: Android.view.InflateException:Binary XML file Line #.. : Error Inflating class Fragmen

This is a version-compatible issue, fragment is added after android3.0, so the minimum API required is 11

Solution:

1. Set the virtual machine to android3.0 later, change the API version of the app to 11 and above, then rerun (the package is android.app.Fragment, inherited Fragment)

2. For the low-version Android also provides another package (at this time to import the package android.support.v4.app.Fragment, inherit the fragmentactivity)

My Android Learning experience 23

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.