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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -