A admac231 Active Member Licensed User Longtime User Jul 23, 2011 #1 I was wondering if this is at all possible? 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. Code: Copy 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? Thanks in advance for any help!
I was wondering if this is at all possible? 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. Code: Copy 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? Thanks in advance for any help!
agraham Expert Licensed User Longtime User Jul 23, 2011 #2 admac231 said: Am I overlooking something stupid here! Click to expand... 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 Upvote 0
admac231 said: Am I overlooking something stupid here! Click to expand... 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
A admac231 Active Member Licensed User Longtime User Jul 23, 2011 #3 Bloody hell that was all? You sir are a gentleman. Thank you Here's the code if anyone is searching for this: Code: Copy Dim o As Reflector o.Target = WebView1 o.RunMethod2("clearCache","False","java.lang.boolean") Upvote 0
Bloody hell that was all? You sir are a gentleman. Thank you Here's the code if anyone is searching for this: Code: Copy Dim o As Reflector o.Target = WebView1 o.RunMethod2("clearCache","False","java.lang.boolean")
agraham Expert Licensed User Longtime User Jul 23, 2011 #4 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. Upvote 0
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.
A admac231 Active Member Licensed User Longtime User Jul 24, 2011 #5 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. Upvote 0
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.
O ondesic Active Member Licensed User Longtime User Sep 27, 2011 #6 Martin mentioned to change the False to True. Changing to True made all the difference for me. Upvote 1