This works lovely for doing it once statically.
But what if I have a font color preference, and I want the preference screen itself to update based on that?
Going with the information from this answer, you could try using a SpannableString
object and set the color that way. The example from that answer:
Spannable summary = new SpannableString ("Currently This Color");
summary.setSpan( new ForgroundColorSpan(color), 0, summary.length(), 0 );
preference.setSummary(summary);
Have a look at my answer to this: Android PreferenceScreen title in two lines.
Add this:
if (textView != null) {
textView.setTextColor(textView.getContext().getResources().getColor(R.color.blue));
}