I found some questions about this problem around the web. Unfortunately, everything i try so far, has been unsuccessful.
Has the title say, i need to change the background color of my action bar.
The project have a min sdk of 9, and max sdk of 19.
I have create in my res/values folder, an xml file:
red_actionbar.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@color/red</item>
</style>
</resources>
the colors.xml stored in res/values
<resources>
<color name="red">#FF0000</color>
</resources>
and the part of the manifest where i change the theme
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomActionBarTheme" >
But nothing changes. Where is the problem? The application accepts the code because if i change ths:
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
to
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar ">
it does change the theme of my app, so the problem is in the style but I don't know how to solve it.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarStyle" tools:ignore="NewApi">@style/MyActionBar</item>
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background" tools:ignore="NewApi">@color/red</item>
<item name="background">@color/red</item>
</style>
</resources>