Can I use SpannableStrings
in a widget's textView? I tried and all it rendered was plain text. I don't know if it is something I'm doing wrong (most likely), or if it just isn't possible for some reason.
Here's the code I'm using (nothing special really...)
public static void updateWidgetState(Context paramContext, String paramString, Integer appWidgetId) {
SpannableString majorLabel = new SpannableString("");
SpannableString minorLabel = new SpannableString("");
if (position > -1) {
majorLabel = GetParsedMajorLabel(paramContext);
minorLabel = GetParsedMinorLabel(paramContext);
}
RemoteViews localRemoteViews = buildUpdate(paramContext, paramString, appWidgetId);
localRemoteViews.setTextViewText(R.id.majorlabel, majorLabel);
localRemoteViews.setTextViewText(R.id.minorlabel, minorLabel);
}
Spanned
object and how you put it into theRemoteViews
? – UnderstateHtml.fromHtml()
to create theSpanned
object out of some HTML snippet, in case the problem lies in yourGetParsed...Label()
methods? – Understate