In my application, I have a webview activity that loads different images. Before loading a web view, I need to know that the image is already cached in the web view cache. I found this working solution for 2.3 Android devices and below:
String uri = "http://the url of the image that you need"; String hashCode = String.format("%08x", uri.hashCode()); File file = new File(new File(getCacheDir(), "webviewCache"), hashCode);
from the message “ Is it possible to access the WebView cache? ”, but I would like to find a solution for all devices, so any help would be appreciated ... Can the web browsing cache directory change? Thanks!
source share