Thanks.
I think I may have solved the problem another way.
I have repositioned my dim and initialise statements for the webview. They were being run each time instead of once.
Sorry if a newbie has wasted some of your time.
----------------------------------------------------------------------
However - when I tried your suggested code (using JavaObject version 1.00 to get it to compile)
I could not get it to work. Hopefully I do not need it now, but it would be nice to learn how to make it work for the future.
I am testing on Android version 2.3.6 Gingerbread.
I received error java.lang.RuntimeException: Method: clearCache Not matched.
Do I have to include some other code to make clearcache available to my program?
Any of the following which are shown in the documentation?
class JsObject {
@JavascriptInterface
public String toString() { return "injectedObject"; }
}
webView.addJavascriptInterface(new JsObject(), "injectedObject");
webView.loadData("", "text/html", null);
webView.loadUrl("javascript:alert(injectedObject.toString())");