Juliatzin
Juliatzin

Reputation: 19695

error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'

I saw a lot of related post in stackoverflow about this message, but it didn't answer my doubts.

In the manifest.xml, I have :

    <uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="19" />

So in the posts, they say because my minSdkVersion is 9, I can't use Theme.Holo.Light.DarkActionBar.

But it is a nonsense because the default folder values-v14 is only for API 14+ users...

So why do I get this error, I want to maintain my android:minSdkVersion = 9. It should be possible no???

Upvotes: 0

Views: 3480

Answers (1)

Emmanuel
Emmanuel

Reputation: 13223

I think you are confused between the resource folder system and the actual Android version range in which your app is supported. When you declare android:minSdkVersion="9" on the AndroidManifest.xml you are stating that your app should be able to run on API 9+.

The Android resource structure was stablished to allow developers to use different resources depending on the resolution, screen size, and Android version (among other things) a given device is running. You still need to respect what your minSdkVersion is set to; in your case it is 9.Theme.Holo.Light.DarkActionBar was introduced on API 11, so you cannot use that style since it was not present in API 9.

To give you an example, trying to use Theme.Holo.Light.DarkActionBar when your minSdkVersion is 9 is like trying to get a reference of the ActionBar when your minSdkVersion is 9 (assuming you are not using the support library). Both of these features were not added until a later API; they were not part of Android, they didn't exist.

Upvotes: 3

Related Questions