我有一些 html 内容必须显示在 android webview 上。这是我在 webview 上显示内容的代码
myBrowser.loadDataWithBaseURL("", myFormHTMLContent , "text/html", "UTF-8", null);
我在 html 内容中有几个 img 标签。我如何为那些指定 src?我试过这个.. src =“/mnt/sdcard/myDir/test.gif”。但它没有加载该图像。请帮我。
最佳答案
试试这个。
src = Environment.getExternalStorageDirectory().getPath()+"myDir/test.gif"
关于android - 当我在 android webview 上加载时 html 文件中的图像路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11980975/