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. Mirror effect on TextView

Trying to write a mirror image of some text.
I created a new widget derived from TextView and the overridden
onDraw(Canvas canvas) looks like

protected void onDraw(Canvas canvas) {
                canvas.scale(-1.0f, 1.0f);

I would expect to see the text flipped around the x axis (mirror
effect) but nothing shows up...
canvas.scale(1.0f, 1.0f) show the text as expected... what is wrong
with that code?

2. ViewGroup and LayoutAnimation question


A question on how a Layout animation works with a ViewGroup object  
such as a ListView. As shown in many ApiDemo examples, when the screen  
is first rendered/layed-out, the animation sequence runs nicely. How  
can one get the Layout animation to re-play on demand. I have tried  
two different mechanisms

        LayoutAnimationController lac = vg.getLayoutAnimation ();

as well as a simple

thinking that the latter will simply cause the whole ViewGroup to re- 
render and therefore replay the animation. Neither of these seems to  

Any ideas?



3. how to install a android system

4. phone to phone applications?

5. ViewAnimator

6. Streaming Music (and maybe Video) From Home PC To Android Device?

7. How to rebuild webkit ??