HTML を webview に投げてレンダリングしています。HTML では、私が持っている画像をロードする必要があります/res/drawable
。
私は/res/drawable/my_image.png
次のようなコードを持っています:
final WebView browser = (WebView) findViewById(R.id.my_webview);
String html = new MyHelper(myObject).getHtml();
browser.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
文字列html
には次のようなものがあります。
<html><head>
<h1>Here is the image</h1>
<img src="my_image.png" />
</head><html>
src
問題は、の画像を参照するには、その画像属性は何であるべきかということ/res/drawable
です。