Android – Fragment API for API level < 11-ThrowExceptions

Exception or error:

I have came across a problem for dynamic forms in my app, which is suited for Android 2.1 and above. I know there is new Fragment API since API level 11 (Android 3.0 Honeycomb), but also I have read an article – stating Fragment Api is available also for API level lower then 11 in, so called, Compatiblity package. I have installed it via SDK, but I am not able to use is in my App, e.g. I cannot import, application doesn’t know it.

Do you know, how to solve it? Is Fragment API truely available for older API levels? If so, how to make them going? Or is there any other solution like Fragments API? I will need for dynamic generated forms if possible



How to solve:

Here’s a nice tutorial on how to implement Fragments on older Android versions, hope this will help you.


Android Studio:

Add a dependency for support compatibility package v4:

dependencies {
    compile ''

and then use import; instead of import; in imports.


You need to add the package to the build path.


Use ActionBarSherlock. It comes with a lot of working examples.

Leave a Reply

Your email address will not be published. Required fields are marked *