• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to clear cache for WebView?

Hello,

I have an Android app that uses WebView to display my website. I want to make it so that whenever the app is closed or stopped being used, the app clear's WebView's cache of HTML files. Currently, I have the following code which clears *all* cache but I only want to clear a specific type of files from the cache (i.e. HTML files):

@override
protected void onStop(){
super.onStop();
browser.clearCache(true);
}

@override
protected void onDestroy() {
super.onDestroy();
browser.clearCache(true);
}​

Any way for me to only clear a specific type of file from cache? Thanks!
 
Back
Top Bottom