I have a WebView that caches its images into a directory using these settings:
mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
mWebView.getSettings().setAppCacheMaxSize( 8 * 1024 * 1024 ); // 8MB
mWebView.getSettings().setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath());
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setAppCacheEnabled(true);
I want to be able to load an image that is cached using this WebView into an ImageView.
I was looking into the directory where the cache dir points to using adb shell (/data/data/com.example.webviewtest/cache), and I found the following folders:
- ApplicationCache.db
- com.android.opengl.shaders_cache
- webviewCacheChromium
Is there some way to find a downloaded image in these directories?
If yes, can I load them into a Bitmap (to use in ImageView)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…