Android: ForegroundColorSpan not working on some devices -
i have following code sets color portion of text:
string fontstring = " \u25fc"; spannable iconspannable = new spannablestring(fontstring); int color = color.parsecolor("#ff00ff00"); iconspannable.setspan(new foregroundcolorspan(color), 0, fontstring.length(), spanned.span_exclusive_exclusive); spannablestringbuilder builder = new spannablestringbuilder(); builder.append(iconspannable); textview labelview = (textview) v.findviewbyid(r.id.label); labelview.settext(builder, textview.buffertype.spannable);
here's result in moto x (shows color intended):
and samsung j1 (doesn't show color):
any ideas on cause of difference?
edit: color work ascii characters, non-ascii character must culprit.
Comments
Post a Comment