我試圖加載存儲在數據庫中的包含圖像的html字符串到WebView
。圖像存儲在內部存儲器中。我給了一個html字符串的引用,但它不起作用。任何幫助?如何在Android WebView中加載本地圖像
String content="<p>Can we have a rotational" +
" symmetry of order more than 1 whose angle of rotation is </p>\n" +
"\n <p>(i) <img alt=\"45\\degree\" src=\"file:///storage/emulated/01484890695248.jpg\" /></p>\n" +
"\n<p>(ii) <img alt=\"35\\degree\" src=\"file:///storage/emulated/01484890697301.jpg\" /></p>";
WebView00.loadDataWithBaseURL("", content, "text/html","UTF-8", "");
WebView00.getSettings();
您是否添加讀取權限?並且也運行時間權限API> 23 – Redman
請檢查此http://stackoverflow.com/questions/4543349/load-local-html-in-webview?rq=1 – user3040153