store cache for WidgetWebView between loads

This commit is contained in:
dkanada 2021-01-09 23:23:17 +09:00 committed by SpiritCroc
parent 3b2f09e80d
commit 4a11802b65
1 changed files with 0 additions and 6 deletions

View File

@ -36,10 +36,6 @@ fun WebView.setupForWidget(webViewEventListener: WebViewEventListener) {
// clear caches
clearHistory()
clearFormData()
clearCache(true)
// does not cache the data
settings.cacheMode = WebSettings.LOAD_NO_CACHE
// Enable Javascript
settings.javaScriptEnabled = true
@ -78,8 +74,6 @@ fun WebView.clearAfterWidget() {
(parent as? ViewGroup)?.removeAllViews()
webChromeClient = null
clearHistory()
// NOTE: clears RAM cache, if you pass true, it will also clear the disk cache.
clearCache(true)
// Loading a blank page is optional, but will ensure that the WebView isn't doing anything when you destroy it.
loadUrl("about:blank")
removeAllViews()