Save image locally and display in webview
I have trouble with this simple piece of code. I download an image from the web and save it locally with : File mFile = new File(context.getFilesDir(), "a.png"); if(!mFile.exists()) { mFile.createNewFile(); } FileOutputStream fos = new FileOutputStream(mFile); fos.write(baf.toByteArray()); fos.flush(); fos.close(); I try to display this image on the ImageView and it's working. Now i try to display the save image on a WebView. String data = "<body>" +"<img src=\"a.png\"/></body>"; webview.loadDataWithBaseURL(getActivity().getFilesDir().toString(),data , "text/html", "utf-8",null); It's not