How am i supposed to reset a WebView
state (cache, cookies, and everything else)?
What I want is that the webview state, preferences, etc. is completely reset to the default (when we first ran the app, or after we have cleared the app data from settings).
Initialize the WebView with the following settings:
Don't use the cache, load from the network.
mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
Sets whether the WebView should save form data.
mWebView.getSettings().setSaveFormData(boolean save)
Then when you want to wipe out, do:
mWebView.clearCache(true);
This clears the resource cache including the disk files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With