Android Html.fromHtml(String) doesn't work for text

后端 未结 12 1494
逝去的感伤
逝去的感伤 2020-12-23 19:32

I am trying to add lines with different colors to my TextView using html tags.

For whatever reason,

    Html.fromHtml(\"

        
12条回答
  •  -上瘾入骨i
    2020-12-23 20:18

    Html.fromHtml("text");
    

    Instead of above please use following

    Html.fromHtml("text]]>");
    

    This worked for me and I am sure it will also work for you.

    Let me know in case of any issue.

提交回复
热议问题