Failed to render Facebook comments on Android WebView via local HTML

*爱你&永不变心* 提交于 2019-11-29 04:20:10

You need to specify a base URL.

myWebView.loadDataWithBaseURL("http://www.example.com", "YOUR_HTML", "text/html", null, null)

To fully replace the line above:

BufferedReader reader = new BufferedReader(new FileReader("file:///android_asset/facebook.html"));
String line;
String html = "";
while((line = reader.readLine()) != null) {
    html += line;
}
reader.close();
myWebView.loadDataWithBaseURL("http://www.example.com", html, "text/html", null, null)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!