I have a one activity and one layout application. I am implementing ActionBarSherlock, but my theme isn’t applying to my emulator/early devices.
My theme.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActivityTheme" parent="Theme.Sherlock">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!-- other activity and action bar styles here -->
</style>
<!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
<item name="android:backgroundSplit">#4200ff</item>
<item name="android:backgroundStacked">#4200ff</item>
<item name="android:background">#4200ff</item>
</style>
</resources>
This causes the ActionBar on my JellyBean device to turn blue, but it stays black on my 2.2 emulator.
Here is a piece from my manifest.xml:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomActivityTheme">
In Android version 3.0 and later you can assign theme to to item name
android:actionBarStyle. But in 2.3 and earlier there is no Action Bar, so you can’t use item with nameandroid:actionBarStyle. To fix this ActionBarSherlock has defined it’s own item name justactionBarStylewithout android prefix.So your code should look like this