Wednesday, November 18, 2015

Android webview how to clear the webview data?


You can follow this way:

mWebView.clearCache(true);
Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.

mWebView.clearFormData();mWebView.clearHistory();mWebView.clearSslPreferences();
this.deleteDatabase("webview.db");this.deleteDatabase("webviewCache.db");

this.finish();mWebView.destroy();




reference:
1  http://stackoverflow.com/questions/2465432/android-webview-completely-clear-the-cache

http://stackoverflow.com/questions/6542943/clearing-all-cached-items-created-by-a-webview

 3http://developer.android.com/reference/android/webkit/WebView.html#clearSslPreferences()

No comments:

Post a Comment