How to have HTML New Line Feature in Android Text View?

前端 未结 6 1566
终归单人心
终归单人心 2021-01-01 12:38

I am using webservice in my android application. In my webservice result I get a HTML formatted String as result.

Assume this is my web service result:

6条回答
  •  无人及你
    2021-01-01 12:49

    The best option is instead of TextView use a WebView and

    final String mimeType = "text/html";
        final String encoding = "UTF-8";
        webView.loadDataWithBaseURL("", contentToShowString, mimeType,
                encoding, "");
    

提交回复
热议问题