Reputation: 2245
I'am writing simple app. I want to run this app on many android devices (from 1.6 do newest). I have minSdk version in manifest: 4 and target 15.
Everything is ok until I change target version to 1.6. Then I have errors for example on this line
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
How to write once and run on many android versions ?
EDIT: Errors: Error retrievieng parent for item: No resource found for given name: Theme.Holo.Light.DarkActionBar
Upvotes: 0
Views: 86
Reputation: 11191
You receieve this error because Theme.Holo has been introduced in sdk > 10
Upvotes: 0
Reputation: 3330
Your target project should always be set to SDK level 15.
With your minimum target at 4, your app will run on 1.6 devices even though you are set to level 15. You will have problems in you lower your target SDK level, because you are using features from 15. The Android build tools in Eclipse will tell you if you are trying to use API features that don't exist down to API level 4.
Make sure you are following the directions in the "Holo Everywhere" blog post: http://android-developers.blogspot.ca/2012/01/holo-everywhere.html ("Using Holo while supporting Android 2.x")
This will ensure you are using the Holo theme on 3.x+ and the classic Android theme on 1.x and 2.x.
Upvotes: 1