Reputation: 117
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?
Upvotes: 0
Views: 9165
Reputation: 6233
if you don't need formatting, use Html.fromHtml(sampleText).toString()
otherwise, you need to extract text from html with jsoup to find and change text like here
Upvotes: 4