The Problem When im setting the ActionBar Background Color the Bar looks like this:
i cant upload Images here so here is the File: Android ActionBar
getSupportActionBar().setBackgroundDrawable(draw);
should be, in your case
getSupportActionBar().setBackgroundDrawable(getResources.getDrawable(R.drawable.your_drawable_name);
The Constructor of ColorDrawable
takes the int that represent the color, not the id
of the color. Use instenad
ColorDrawable draw = new ColorDrawable(getResources().getColor(R.color.grey));
Edit:
about the style.xml, you need both the item with and without the android prefix:
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:actionBarStyle">@style/ActionBarTheme</item>
<item name="actionBarStyle">@style/ActionBarTheme</item>
</style>
Lint is probably going to complain about it, because of the minSDK value. if it does you can add tools:ignore="NewApi"
to the item with the android:
prefix. For instance:
<item name="android:actionBarStyle" tools:ignore="NewApi">@style/ActionBarTheme</item>