使用WebView的loadDataWithBaseURL方法加载远程图像URL

时间:2014-08-06 11:52:30

标签: android html string android-webview

我需要加载包含远程图像src。

的HTML内容

所以我写了一个像下面的字符串

String trl = "<html><body><a id=\"example1\"  href=\"http://example.com/android/images/4252054277_f0fa91e026.jpg\"><img alt=\"example1\" src=\"http://example.com/android/images/4252054277_f0fa91e026_m.jpg\" /></a></body></html>";

然后我加载以下网址

webview.loadDataWithBaseURL("", trl, "text/html", "UTF-8", "");

它显示文字,即&#34;示例-1&#34; ,而不是显示网址中的图片。我也仔细检查图像的位置。它们是有效的。

我做错了什么?

0 个答案:

没有答案
相关问题