sachi
sachi

Reputation: 2132

Path of image in html file when i load on android webview

I have some html content which has to be displayed on android webview. Here is my code to display the content on webview

myBrowser.loadDataWithBaseURL("", myFormHTMLContent , "text/html", "UTF-8", null);

I have few img tags in html content. How can i specify the src for those? I tried this .. src = "/mnt/sdcard/myDir/test.gif". But its not loading that image. Please help me.

Upvotes: 1

Views: 1461

Answers (1)

Hardikgiri Goswami
Hardikgiri Goswami

Reputation: 514

Try this.

src = Environment.getExternalStorageDirectory().getPath()+"myDir/test.gif"

Upvotes: 3

Related Questions