Android WebView Cache lost after activity closed

Viewed 55

While I'm navigating inside WebView caching work fine, after once I closed WebActivity and launch again it loaded all resources again.

    webSettings.javaScriptEnabled = true
    webSettings.loadWithOverviewMode = true
    webSettings.builtInZoomControls = true
    webSettings.displayZoomControls = false
    webSettings.domStorageEnabled = true
    webSettings.allowFileAccess = true
    webSettings.cacheMode = LOAD_DEFAULT

I go through various solution available on stackoverfolw but not get any of them worked. I'm not using clearCache().

Can anyone please help me on how to resolve this issue?.

Thanks!

1 Answers

Have you tried ?

webSettings.clearCache(false);

might be workful for you !

Related