Change the Background Color on an Action Bar


1. Add Action Bar to your project.

2. Open the ActivityMain.java file and add the below imports to the imports section.

    import android.app.ActionBar;
    import android.graphics.drawable.ColorDrawable;

3. Then, in the ActivityMain.java file add the below to the onCreate method.

           ActionBar ab = getActionBar(); 
ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#81a3d0"));    
          ab.setBackgroundDrawable(colorDrawable);

4. Determine the Hex color you would like and update the Color.parColor above to your specific color.

5. Compile and run!

Resources:
http://stackoverflow.com/questions/11770512/change-actionbar-background-color-in-code-from-navigation-list

Other Resources