Customizing color for the navbar of my Android app I got my navigation bar to be the color I want of Blue background with white text.

Here is my code which works but this feels totally hacky. Please suggest improvements
styles.xml
&lt;resources&gt;
    &lt;style name=&quot;AppTheme&quot; parent=&quot;@android:style/Theme.Holo.Light&quot;&gt;
        &lt;item name=&quot;android:actionBarStyle&quot;&gt;@style/MyActionBar&lt;/item&gt;
    &lt;/style&gt;

    &lt;!-- ActionBar styles --&gt;
    &lt;style name=&quot;MyActionBar&quot; parent=&quot;@android:style/Widget.Holo.Light.ActionBar&quot;&gt;
        &lt;item name=&quot;android:background&quot;&gt;#6a9abd&lt;/item&gt;
        &lt;item name=&quot;android:titleTextStyle&quot;&gt;@style/TitleBarTextColor&lt;/item&gt;
    &lt;/style&gt;

    &lt;style name=&quot;TitleBarTextColor&quot; parent=&quot;@android:style/Widget.Holo.Light.ActionBar&quot;&gt;
        &lt;item name=&quot;android:textColor&quot;&gt;#ffffff&lt;/item&gt;
    &lt;/style&gt;
&lt;/resources&gt;
You could actually name (i.e. wrap in a proper resource) the color you used there, and thus reference it easier in the future. Not only that, but properly defining resources is recommended for Android development, and depending on the tools you use, you might see them complaining if you don't. 

Inside

/res/values/colors.xml


you could define yours as

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;
    &lt;color name="my_amazing_blue"&gt;#6a9abd&lt;/color&gt;
&lt;/resources&gt;


and then reference it as

@color/my_amazing_blue


in the XML, or

Resources res = getResources();
int myAmazingBlue = res.getColor(R.color.my_amazing_blue);


in your Java code.

Also note that for Android, resource names are usually cased_like_this.