任何人都可以告诉我在WebView类中loadData()和loadDataWithBaseURL()之间的区别.
当我web.loadDataWithBaseURL("",html, mimetype, encoding,"");在我的程序中使用,其中html是包含硬编码的html标签的字符串,它的显示就像html页面一样,当我在我的代码中使用loadData(html,mimetype,encoding)应用程序正在关闭时.
我读了API但无法理解.....所以请帮帮我...
提前致谢
灰
万一有人遇到这个,WebView.loadData似乎被破坏了:
http://code.google.com/p/android/issues/detail?id=1733#c23
http://code.google.com/p/android/issues/detail?id=3552
OP问题中提出的解决方案的变体似乎是变通方法.我认为空值比""便宜,所以我使用了这个:
web.loadDataWithBaseURL(null,html, "text/html", "utf-8",null);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4737 次 |
| 最近记录: |