Oleg Ryabtsev Oleg Ryabtsev - 3 months ago 30
Android Question

Parse HTML with Html.fromHtml

I have a

in my application and some HTML text.

This text contains symbols like "<" or ">" and HTML tags.

Here's a sample:

<P>very often (>1/10), often (>1/100, <1/10), not often (>1/1000, <1/100), rarely (>1/10000, <1/1000), very rarely (1/10000, including individual)</P>

I've tried to use
method and it returns me an incorrect text:

very often (>1/10), often (>1/100, 1/1000, 1/10000),

My question is: how can I parse html using
to avoid this situation?

Or is there any another ways to parse HTML?


Use &lt; (read: "less than") to replace <, and &gt; (read: "greater than") to replace >.