0

I am having Problems filling my TextView. I have an HTML String that needs to be converted from HTML to String and the replace some characters. Problem is: I can convert it directly with: TextView.setText(Html.fromHtml(sampleText);

But I need to alter the converted sampleText before giving it to the TextView.

E.g.:

String sampleText = "<b>Some Text</b>"
newSampleText = Html.fromHtml(sampleText);
newSampleText.replace(char1, char2);
TextView.setText(newSampletext);

Does anyone know how to convert the HTML saved inside the String?

Markus Schmitz
  • 97
  • 3
  • 13
  • 1
    Perhaps you should just `sampleText.replace(char, char);` before calling `TextView.setText(Html.fromHtml(sampleText))`. – LightYearsBehind Sep 02 '15 at 10:01
  • Yeah, I know, Problem is, that I want to replace
  • with a break. but Html.fromHtml deletes all spans. And Replacing
  • with "\n" before conversion does not work for me.
  • – Markus Schmitz Sep 02 '15 at 10:03