I am trying to convert a html String and set it to a TextView but I couldn't do it exactly.
Here is my String, "Hello, %1$s! You have <b>%2$d new messages</b>"
I am using textview.setText(Html.fromHtml(myString)); which produces me an output with Html Tags instead of plain text. Can anyone help me with this?
Any help is much appreciated. Thanks
Refer to this question.
try:
textView.setText(Html.fromHtml(myString), TextView.BufferType.SPANNABLE);
This may be helpful to you:
Spanned marked_up = Html.fromHtml(myString);
textview.setText(marked_up.toString(),BufferType.SPANNABLE);
Try use this version of setText and use SPANNABLE buffer type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With