Skip to content Skip to sidebar Skip to footer

Android Fragments On Lower Api

well I'm starting to understand Android Fragments but this is still confusing for me. I need a little help. As it says android fragments is supported since API level 11 but you can

Solution 1:

You are still using the android.view.fragment class, which does not exist. You have to switch to android.support.v4.app.fragment on older devices.

Solution 2:

If you are using a lower API because of the minSdkVersion, you should know that you can use the latest sdk and set the minSdkVersion to a lower value. They have not to be the same.

Solution 3:

Actually, this issue is from ADT tools.

  1. re-order the "Order and Export" in Java Build Path by src > gen > Private > other...

  2. Add Support Library >> android-support-v4.jar

Solution 4:

OK so I had the same issue, and finally got it working. First of all make sure you have the latest ADT tools.

1)Go into every activity that uses fragments and have them extend from FragmentActivity instead of Activity

2)if you haven't imported the support library into your build, then right-click on your project->Android Tools->Add Support Library

3)make sure in your xml the tags are <fragment /> and not <android.support.v4.app.fragment />

hope that helps you out, took me a while to get it working.

Post a Comment for "Android Fragments On Lower Api"