How to change action bar title color in code
You can use a SpannableString and ForegroundColorSpan to set the colour of the title
Spannable text = new SpannableString(actionBar.getTitle());
text.setSpan(new ForegroundColorSpan(Color.BLUE), 0, text.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
actionBar.setTitle(text);
Another way is using Html
getSupportActionBar().setTitle((Html.fromHtml("<font color=\"#FF4444\">" + getString(R.string.some_string) + "</font>")));
The ActionBar
title ID is hidden, or in other words, it's internal and accessing it can't be done typically. You can reference it using Resources.getIdentifier
then View.findViewById
though.
Grab the ID for the action_bar_title
int titleId = getResources().getIdentifier("action_bar_title", "id", "android");
Now you can use the ID with a TextView
TextView abTitle = (TextView) findViewById(titleId);
abTitle.setTextColor(colorId);