How to change the color of the Toolbar text programmatically
<p>My toolbar title needs to be able to change color depending on button click. For example, the default color for the toolbar title is white, but if I press a button, I want it to change to red for example.</p>

<p>I tried using the following:</p>

<pre><code>SpannableString title;
title.setSpan(new ForegroundColorSpan(Color.argb(1, 255, 64, 129)), 0, remainingTitle.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
</code></pre>

<p>But for some reason the color just does not want to change. It used to work with actionbar, but for some reason this same method does not work with toolbar.</p>