实际上,我正在从 json Web 服务检索文本,该文本是包含标签等的 HTML 文本,我正在使用 Html.fromHtml 执行该文本,但问题是特殊字符显示为带有问号的菱形,而我不是能够以正确的形式显示。 下面是我遇到问题的代码
Description=Description.replaceAll("\\<.*?>","");
Description=Description.replaceAll("\\“", "");
Description=Description.replaceAll("\\”", "");
// Description=Description.replaceAll("♦", "");
//Description=Description.replace("“", "");
details.setText(Html.fromHtml(Description).toString());
描述是我存储html文本的字符串变量,我用谷歌搜索了很多,但没有得到任何东西。希望我能从这里得到一些东西 提前致谢
最佳答案
在我的 WebView 中我做了这样的事情。
productInfoWebview.loadData(value, "text/html; charset=UTF-8", null);
关于android - 如何在 android TextView 中显示 html 特殊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18889414/