Websettings.SetAppCacheEnabled deprecated, what to use instead?

24.1k Views Asked by At

During an attempt to bring an older android application into the modern world, I have come across the deprecated statement of:

websettings.setAppCacheEnabled(false)

What is the modern Androidx alternate?

2

There are 2 best solutions below

2
Jithish P N On BEST ANSWER

Use this

webView.settings.cacheMode=WebSettings.LOAD_NO_CACHE

Refer : https://developer.android.com/reference/android/webkit/WebSettings

3
Techy Rakshak On

Alternatively, this helped me out:

webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);