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. java.lang.NullPointerException when trying to edit strings.xml

Thanks, this helps






-- 

2. Build with SDK tool rev 7, gives error: if doesn't support the nested "istrue" element

Our project was built  fine with SDK tool rev 6 and Ant version 1.7.1.
After updating the SDK tool to rev 7 we start seeing error:

if doesn't support the nested "istrue" element

below is ant task has istrue:

    <taskdef name="setup"
        classname="com.android.ant.SetupTask"
        classpathref="android.antlibs"/>
                <if>
                <!--  This work fine with SDK tool Rev 6  -->
                <istrue value="${build.debug}"/>
                <then>
                                <mkdir dir="${build.dist}/dbg_libs/"/>
                </then>
                <else>
                                <mkdir dir="${build.dist}/rel_libs/"/>
                </else>
        </if>

    <setup />

-- 

3. Android Better than Apple

4. Eclipse not installing Android Application on Emulator

5. Android Types

6. How Write a background service to get latitude and longitude

7. MyTouch 3G Slide test request