-1

How would I change the action bar's color?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Jeremy Ahn
  • 335
  • 2
  • 5
  • 17
  • Your layout `xml` file you are using with your current activity has most of the design attributes like color. – Anirudh Ramanathan Aug 25 '12 at 04:21
  • You reaaaaaally searched hard? [1](http://stackoverflow.com/questions/5589943/android-3-0-actionbar-changing-colors) [2](http://stackoverflow.com/questions/8024706/how-do-i-change-the-background-color-of-the-actionbar-of-an-actionbaractivity-us) [3](http://stackoverflow.com/questions/5861661/actionbar-text-color) [4](https://www.google.ca/search?q=android+change+action+bar+color) – Cat Aug 25 '12 at 04:24

1 Answers1

0

Try the following code.

Fetch the id from the Android resource (just like we fetch id from R.java)

int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");

Now you use TextView with the id we fetch.

TextView textView = (TextView)findViewById(titleId);
textView.setTextColor(colorId);

Have a look at to Advance Styles in Android.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Lucifer
  • 29,392
  • 25
  • 90
  • 143