I am using a CursorAdapter and ContentProvider, and I want to use CursorLoader, so I reconfigured my project to target API 11 and set min-sdk-ver to 7. However it crashes when an Activity calls a sub-Activity which uses the CursorLoader. The error is NoClassDefFoundError delivered via IllegalStateException.
My question is can we use Honeycomb APIs in previous Android versions even if we have the same configs a have?
If you wish to use
CursorLoaderin an Android application supporting pre-API Level 11 devices, you will need to use the Android Compatibility Library (ACL). You can download that via the SDK and AVD Manager and copy the JAR from your SDK installation into your project. Then, you will need to usesupport.v4versions of the loader classes, plus inherit fromFragmentActivity, so you can callgetSupportLoaderManager()to get your ACL edition of theLoaderManager.This blog post describes (briefly) the ACL. A sample app using
CursorLoaderis found packaged with the ACL itself. You can also review a tutorial on using ACL’s edition ofCursorLoader.