peterlawn
peterlawn

Reputation: 2381

android webview use <img> load a image from sdcard

i'm trying use webview to load a image from sdcard

i use this path :

file///sdcard/1.png

but i didn't see the picture.

is anything wrong?

Upvotes: 0

Views: 2073

Answers (1)

Mudassir
Mudassir

Reputation: 13174

One solution is to put your HTML and image file in the asset folder, and load the HTML file from there. Another solution is to use the method loadDataWithBaseURL() of WebView.

Upvotes: 2

Related Questions