Webview questions

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

Sponsored Links

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?


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. Jitter in the Gallery widget

I would like to get rid of the "snap" animation in the Gallery widget

If you look closely at the way the gallery animates, it looks like it
"overshoots" the position it is going to come to rest to and then
animates back to the position.  I would like to get rid of this
overshoot and animate back.  I would simply like to use an easing
function such as an AccelerateDecelerateInterpolator to animate
exactly to the position it will come to rest to.

Can anybody point me in the direction of where I would need to look to
change the physics/animation of the Gallery to achieve my objective?



2. aapt crashes with -v

I noticed in my project that the latest appt crashes if verbose (-v)
output is turned on. Works fine without verbose output on the same

Thats the last output I see:

trying overlaySet Key=icn_dropdown_43x43.png
baseFile zd has flavor (null)
overlayFile zd has flavor (null)
found a match (zd) for overlay file (null), for flavor
trying overlaySet Key=icon.png
baseFile zd has flavor (null)
overlayFile zd has flavor (null)

Platform is win32. I could also provide more details of the crash from
the Windows crash reporter if required.
This was really annoying to find. :-)



3. Task State Being Lost

4. AlarmManager problem

5. Web Service response is in HTML format instead of XML

6. Wifi and Gingerbread

7. Samsung Galaxy S