0

I tried other solutions on Stack Overflow but those are for older versions of Android Studio. In Android Studio 4.1.1, there is "color.xml" instead of "styles.xml." That's why the older solutions didn't work for me.

enter image description here

Adrian Mole
  • 43,040
  • 110
  • 45
  • 72
  • `color.xml` does not replace `styles.xml` I am sure you can add `styles.xml` in values folder and you can make your changes there. – noname Dec 18 '20 at 11:32
  • 4
    Does this answer your question? [Set title background color](https://stackoverflow.com/questions/2251714/set-title-background-color) – noname Dec 18 '20 at 11:33
  • Please add links to the solutions you tried – fdermishin Dec 18 '20 at 13:08

1 Answers1

0

You can use something like this:

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("Hello");
toolbar.setTitleTextColor(Color.RED);//for red colored toolbar title
Usama Altaf
  • 1,036
  • 1
  • 4
  • 23