I'm trying to implement cursor loaders into my android app. When I write the code for LoaderManager
s, eclipse prompts me to import the correct libraries. However there are two options which appear to be the same; android.app
and android.support.v4.app
. Whats the difference between these two, and which one should I use?
The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.
This both are different library android.app
is for the ie Fragment
which are available from the API level 3.0 and above. So to use the Fragments
in below api's you have to use its backword compatible libraries form android.support.v4.app
to support below the API level than 3.0. So android has provided the flexibility to provide the support in lower version using android.support.v4.app
library.
Each Support Library is backward-compatible to a specific Android API level. So whenever you are implmenting anything which is available in 3.0 but not below then you should use its support library.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.