Android WebView - Update app cache nicelly

Oscar Brito


By searching google for code snippets do force an update to the app cache of my Web View I did not found any good method to do it, so here is my recipe to force an update to the app cache.

1) before load url disable the cache

browser.getSettings().setCacheMode(WebSettings.LOADNOCACHE);

2) when the browser is ready, and resources are downloaded ( from the new version of the manifest)

browser.getSettings().setCacheMode(WebSettings.LOAD_NORMAL);

3) load again the url, and you have the new version of app cache.

That it. A Three phase method, just like a normal browser do.

Oscar Brito - http:://divhide.com



Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.