I've tried using the reflection library but it throws up a NoSuchMethod error for the clearCache method. Other methods run successfully so I really don't know why it isn't working.
B4X:
Dim Obj1 As Reflector
Obj1.Target = WebView1
Obj1.RunMethod2("clearCache","False","java.lang.Boolean")
Am I overlooking something stupid here or is there a reason this can't be done?
Yes! You are defining a clearCache method with a parameter of type "java.lang.Boolean" which is a true Object that is a boxed boolean. The paramater type you need is a boolean primitive "java.lang.boolean". See the list of types Basic4android - Reflection
Actually you don't need to use the string "False", Basic4android, being semi-strongly typed, will coerce the False keyword to a string, and indeed will also coerce numeric literals to a string where needed, and vice versa if the conversion is possible.
Sorry to bring this up again but it would seem that the clearCache() method is very temperamental. As in sometimes it works and sometimes it doesn't. I really don't know what's causing it to stop working.
In addition, I've tried clearing out the webviewCache folder created in DirInternalCache but this also doesn't seem to do anything. Argh.