Reputation: 169
May I know if there have any way to show out "<>" or something like "<>ddd" normally using HTML.from() in textview?
the character is all missing after that invalid HTML tag ...
Upvotes: 0
Views: 63
Reputation: 5882
you should escape the characters, < is <
(Less Than) and > is >
(Greater Than)
so:
textView.setText(Html.fromHtml("<>ddd"));
will output
Upvotes: 0
Reputation: 1879
Use <
for <
and >
for >
For example textView.setText(Html.fromHtml("<h1>Hello <World></h1>"));
This results in Hello <World>
Upvotes: 1