开发者

Will WebView cache persist between application runs?

开发者 https://www.devze.com 2022-12-23 06:06 出处:网络
I have a WebView. I\'m not quite sure how caching works for it. Ideally I\'d like to load a webpage from the network once (images included), then from then on only ever load it from the local cache. I

I have a WebView. I'm not quite sure how caching works for it. Ideally I'd like to load a webpage from the network once (images included), then from then on only ever load it from the local cache. I'm not sure if we have this level of control over webview. Will it at some point just auto-clear the cache? How could I tell? I need to be sure that开发者_如何学Python it's really keeping the page cached between different runs of my application.

http://developer.android.com/reference/android/webkit/WebSettings.html

the cache modes there don't seem to specify if the cache persists between runs of the application or not?

Thanks


Check out the cache folder in your apk's data directory

in a command prompt run

adb shell
#cd /data/data/yourpackage
#ls
<<you should see a cache directory>>
0

精彩评论

暂无评论...
验证码 换一张
取 消