Currently I have a theme specified in AndroidManifest.xml file:
android:theme="@android:style/Theme.Holo.Light"
Now I’m working to create the application backward compatible. As long as Gingerbread doesn’t have Theme.Holo.Light I’ll use Theme.Light but how to apply needed theme depending on OS version?
Use resource qualifiers for your values folder:
e.g.
res/values-v11Have your style reference
Theme.Lightin the standardres/values/styles.xml, then referenceTheme.Holo.Lightinres/values-v11/styles.xml. If it’s running on API 11+, it will automatically choose Holo; otherwise, it will fall back to the standardTheme.Lightspecified inres/values/styles.xml.