Webview questions

by Roy M » Mon, 13 Apr 2009 21:14:12 GMT


Sponsored Links
 Hello,

say I have a local html invoked using webview, has the content...

<a herf="foo('me')"> test </a>


Is it possible when user click on the hyperlink, a method in my Java
class called foo() will be called?

Or any otherway to keep track if a user clicked on a specific elements
in the HTML page?


Thanks
--~--~---------~--~----~------------~-------~--~----~



Webview questions

by Mattaku Betsujin » Mon, 13 Apr 2009 22:52:04 GMT


 You need to do this:

<a href="javascript:window.jsinterface.mymethod('parameter')"> xxx </a>

In Java code:

intf = new Object {
    public void mymethod(String param) {
        ....
    }
}

myWebView.addJavascriptInterface(intf , "jsinterface");





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links