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

HI,
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

@Override
protected void onDraw(Canvas canvas) {
                canvas.scale(-1.0f, 1.0f);
                super.onDraw(canvas);
}

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?
Thanks
Stephane
--~--~---------~--~----~------------~-------~--~----~

2. ViewGroup and LayoutAnimation question

Hello,

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 ();
        lac.start();

as well as a simple
        vg.requestLayout();

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

Any ideas?

Thanks,
DS.




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

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 ??