简体   繁体   中英

How to cache WebView content in Android?

In my Android app I need to cache the (already loaded) content of WebView on pause and then restore it on resume. I wonder how can I do this?

It is cached automatically unless you disable. Nothing special needs to be done.

A common problem is that badly designed parent resets the view itself in methods like onStart or onResume , forcing to reload the contents. You need to be careful with the view in these methods, it may already with content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM