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


Other Threads

1. SMS Importer lite

om ane cari di market belum ada versi berbayarnya... baru lite aja.



-- 
sent from my motodroid with froyo inside

-- 
"Indonesian Android Community [id-android]" 

2. Decent Android reference book?

Is there one?  I have "Professional Android 2 Application Development"
by Meier and "Teach Yourself Android Application Development in 24
Hours" by Darcy/Conder.  Both are mediocre at best.

Neither is a decent REFERENCE, but rather they are basically
structured as tutorials, without nothing in the way of reasonably
comprehensive API documentation (which also, BTW, is woefully
inadequate on the android.com site).  And no sort of in-depth
discussion of the structure of the system, so one could perhaps
understand it rather than simply using the (inadequate) cookbooks.

-- 

3. Udp +Tcp connection in Android

4. Sprint push-to-talk Motorola i1 Android phone coming Sunday

5. OOT : hepi besday cici ping ping

6. Penampakan Nexiandroid..

7. How to remove compiling warning "the mangling of 'va_list' has changed in GCC 4.4" when build Android source files