android.text.Html.fromHtml()无法解析<ol><li> </li></ol>应该怎么解决
迷茫
迷茫 2017-04-17 17:58:44
0
1
653

下面一段html文本
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
如何在TextView上显示成这样的格式:
1.Coffee
2.Tea
3.Milk
用Spanned sp = Html.fromHtml(html);来解析的话,有一部分html标签识别不了,就会显示成CoffeeTeaMilk;

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
巴扎黑

You can use the static Spanned Html.fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler) method to implement the Html.TagHandler interface to parse unsupported html tags

handleTag(boolean opening, String tag, Editable output, XMLReader xmlReader)
opening, indicating the start tag or end tag
tag, tag name
output, output object

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template