mightimaus
mightimaus

Reputation: 1089

Can't reference Holo theme from values-v11/themes.xml

I'm trying to make my app use the Holo Light theme if it is running on a 3.0+ device, but for some reason the values-v11 method isn't working. I see a bunch of other people apparently using this method, but when I define my theme in res/values-v11/themes.xml:

<resources>
<style name="MainStyle" parent="@android:Theme.Holo.Light">

</style>
</resources>

Eclipse gives me error: Error retrieving parent for item: No resource found that matches the given name '@android:Theme.Holo.Light'. It's the same whether I use android:Theme.Holo.Light or android:style/Theme.Holo.Light.

My minSdkVersion is set to 10 and my targetSdkVersion is set to 15.

Any ideas?

Upvotes: 8

Views: 10446

Answers (3)

back track
back track

Reputation: 209

TextAppearance.Holo.Widget.ActionBar.Title appears to have been added in API Level 13. Make sure your build target is set to 13, not just 11.

AndroidManifest.xml:

<uses-sdk
    android:minSdkVersion=...
    android:targetSdkVersion="11" />

Upvotes: 0

Anil Chahal
Anil Chahal

Reputation: 2613

Set your Project Build Target above or equal to 14 and make sure you used correct syntax for Theme.Holo.Light. It should be like this parent="@android:style/Theme.Holo.Light"

Upvotes: 0

Cat
Cat

Reputation: 67502

I suspect you should be using parent="@android:style/Theme.Holo.Light". Make sure it's exactly like this--with the @ sign and everything.

From comments: Also make sure you've set your target API (different from the target SDK) in the Project Properties (not the manifest) to be at least 4.0/API 14.

Upvotes: 10

Related Questions