I've reading lot of stuff about styling the Action Bar and changing the Action Bar background color using XML, posts like How do I change the background color of the ActionBar of an ActionBarActivity using XML?
But the point is that my Action Bar does not change from its default dark grey color. To summarize and keep it simple, I've got this in my styles.xml:
<!-- Base application theme. -->
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">...</item>
</style>
I think the problem may come from my parent Theme (Base.Theme [...]). But I cannot change it, I need the AppCompat component.
By the way, I've changed the color succesfully programatically using:
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(...));
But doing so I have this code repeated in every activity...something I want to avoid using the styles xml.
Any idea?
Thanks in advance!
EDIT
Finally got it, just need to add
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/dark</item>
Besides the android:[...], the attr needed were the previous