Possible Duplicate:
Set title background color
How can I change the titlebar color in an Android app?
I tried:
this.setTitleColor(Color.BLUE);
but it changes color of written text on it not title bar color.
Just go to res/values/styles.edit the xml file to change the color of action bar.
Android Title Bar or ActionBar or Toolbar is the header of any screen in an App.
getWindow() method of Context return the current view context, for get the title bar of an Activity, android.id.id.title
View title = getWindow().findViewById(android.R.id.title);
View titleBar = (View) title.getParent();
titleBar.setBackgroundColor(Color.RED);`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With