我有一个WebView,它使用以下设置将其图像缓存到目录中:
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);
我希望能够将在WebView中缓存的图片加载到ImageView中。
我使用adb shell查看缓存目录指向的目录(/data/data/com.example.webviewtest/cache),发现以下文件夹:
- ApplicationCache.db
- com.android.opengl.shaders_cache
- webviewCacheChromium
是否有一种方法可以在这些目录中找到已下载的图片?
如果可以,我可以将它们加载到位图中(在ImageView中使用)吗?