This is really a weird situation, I set up a normal ListPreference, hoping to set its summary color to another customized color, as I did for all the other preference widgets, like this:
String mainSummary = listPreference.getSummary().toString();
Spannable coloredMainSummary = new SpannableString (mainSummary);
coloredMainSummary.setSpan( new ForegroundColorSpan(Color.RED), 0,
coloredMainSummary.length(), 0 );
listPreference.setSummary(coloredMainSummary);
But it didn't work anymore, I can still set the summary to other text that I wanted, but the color won't change as I wanted anymore. Is it because ListPreference
doesn't support Spannable
? or is there something else that I need to do?