Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 264
mightimaus Avatar asked Aug 30 '12 04:08

mightimaus


1 Answers

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.

like image 124
Cat Avatar answered Sep 27 '22 20:09

Cat