Java – Additional colors for toolbar title initials

Additional colors for toolbar title initials… here is a solution to the problem.

Additional colors for toolbar title initials

I wish my toolbar had a colored title. That’s not a problem. But how can I achieve the first letter of the tile, for example black, and the rest white?
Is this possible?

Solution

One possibility is to use Html.fromHtml to change the font color of both parts of the string. egp>

String first = "<font color='#FF000000'>F</font>";
String rest = "<font color='#FFFFFFFF'>irst</font>";
setTitle(Html.fromHtml(first + rest));

Related Problems and Solutions