how to save images displayed in webview?

android

Solution

WebView webView = new WebView(this);
//your image is in webview

Picture picture = webView.capturePicture();
Canvas canvas = new Canvas();
picture.draw(canvas);
Bitmap image = Bitmap.createBitmap(picture.getWidth(),
picture.getHeight(),Config.ARGB_8888);
canvas.drawBitmap(mimage, 0, 0, null);
if(image != null) {
    ByteArrayOutputStream mByteArrayOS = new
    ByteArrayOutputStream();
    image.compress(Bitmap.CompressFormat.JPEG, 90, mByteArrayOS);
    try {
        fos = openFileOutput("image.jpg", MODE_WORLD_WRITEABLE);
        fos.write(mByteArrayOS.toByteArray());
        fos.close();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

try the above to capture image from webView

Problem

I want to save the images displayed in webview into local storage, and webview should have cached the images it displays ,how can i access the cached images and save them into storage?

Original source