Note that there are some explanatory texts on larger screens.

plurals
  1. PODifferent Theme for different Android SDK versions
    primarykey
    data
    text
    <p>Is there a way to use a different theme depending on which SDK version the application is installed on?</p> <p>The reason I ask is because I want to support all the way back to SDK version 8, but for those users that have ICS I want to be able to follow the design standards for ICS and use the Holo theme.</p> <p>I can see from <a href="https://stackoverflow.com/questions/8908508/program-different-layouts-for-different-versions-in-android">Program different layouts for different versions in android</a> that I can have a folder values-v14 which will have a theme.xml to override the theme declaration. However, it won't compile if I reference Theme.Holo. I believe this is because I have the following in my AndroidManifest.xml</p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" /&gt; &lt;uses-sdk android:targetSdkVersion="11"/&gt; </code></pre> <p>Any pointers would be much appreciated.</p> <p>UPDATE:- OK so here are my files:- AndroidManifest.xml:</p> <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:name=".Refunder" android:theme="@style/MainTheme" &gt; </code></pre> <p>res/values/themes.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;style name="MainTheme" parent="@android:style/Theme.Light.NoTitleBar"&gt; &lt;item name="android:typeface"&gt;normal&lt;/item&gt; &lt;item name="android:textSize"&gt;15sp&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>res/values-v11/themes.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;style name="MainTheme" parent="@android:style/Theme.Holo"&gt; &lt;item name="android:typeface"&gt;normal&lt;/item&gt; &lt;item name="android:textSize"&gt;15sp&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>This is in accordance with the article I read here:- <a href="http://android-developers.blogspot.com/2012/01/holo-everywhere.html" rel="nofollow noreferrer">http://android-developers.blogspot.com/2012/01/holo-everywhere.html</a></p> <p>When I do this I get a compile error in Eclipse saying that:-</p> <pre><code>error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload