0

i have the response from website, in html, i have put this in String variable, now for example i want to color all tag "table" in red, i try with this:

String s = "<font color='#FF0000'><b>table</b></font>";
Spanned text =  Html.fromHtml(s);

rowID=rowID.replace("table",text);
responseView.setText(rowID);

but not works..how i can to manipulate it? there is a library to help me?, the problem is because i put the manipulate response in a TextView ?

1
  • ok sorry..but the problem still going.. because if i try String s = "<font color='#FF0000'><b>table</b></font>"; Spanned text = Html.fromHtml(s); responseView.setText(rowID); works very well :) but with this rowID=rowID.replace("table",text); not Commented Nov 13, 2013 at 9:38

1 Answer 1

1

Try this: responseView.setText(Html.fromHtml(rowID), TextView.BufferType.SPANNABLE);

Sign up to request clarification or add additional context in comments.

1 Comment

works but i must delete this: Spanned text = Html.fromHtml(s);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.