This is related to my previous question of 'How can I clear my app's localStorage on my Android emulator each time I install it?'.
It also builds on 'How can I clear the Android app cache?' and 'How to programatically clear application data?'.
None of the above questions give a straightforward answer that is applicable to Android PhoneGap/Cordova applications. This blog post by Igor Hrupin covers the situation in the context of a native Android app, so this question extends that to cover Cordova.
I will post an answer myself, but I am a total Java noob, so please edit to improve.
just saw this one. It can be done with one line. I am not sure if this is what you want but it serves my purpose which is clearing the cache on startup
https://coderwall.com/p/aj79eg
super.clearCache(); // just add This Line
super.loadUrl("file:///android_asset/www/index.html");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With