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):

moto x - works ok

and samsung j1 (doesn't show color):

enter image description here

any ideas on cause of difference?

edit: color work ascii characters, non-ascii character must culprit.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -