android - Change color font only in part of textview -


i want change part of textview color.. i've tried in way nothing change

textview textview = (textview)findviewbyid(r.id.temperature); textview.settext("temperature: "+ "<small> <font color='#59c3fa'>" + temperature + "°c</font></small>"); 

so first part "temperature: " has have textview color (black in case), , rest of part #59c3fa. how wrong?

please use html class this.

textview.settext(html.fromhtml("temperature: "+ "<small> <font color='#59c3fa'>" + temperature + "°c</font></small>")); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -