Difference between android.content and android.support.v4.content

1

When I use Fragments or AsyncTaskLoader, two options appear for the same element: android.content and android.support.v4.content

What's the difference between the two?

These are the settings for my project:

minSdkVersion 15
targetSdkVersion 23
    
asked by anonymous 10.02.2018 / 19:14

1 answer

1

android.content refers to a namespace in the Android SDK whose API version is the one indicated in compileSdkVersion .

android.support.v4.content refers to a namespace in the support-v4 library. It is included in the project when you use build.gradle , compile 'com.android.support:support-v4:25.4.0'

Support libraries are designed to provide classes and methods that exist in the latest versions of the SDK so that they can be used on devices with older versions of the SDK where these classes and methods did not exist.

The reason why you see more than one option is because the same class exists in both namespace .

    
11.02.2018 / 22:27