On the HTML page associated with the OK button:
function ok() { var t1 = document.getElementById("textarea1").value; var t2 = document.getElementById("textarea2").value; var t3 = document.getElementById("textarea3").value; var t4 = document.getElementById("textarea4").value; var result = JSON.parse(bridge.doIt(t1,t2,t3,t4)); } }
In a webview application:
class MyBridge { public MyBridge(Context context) {
and in the webview constructor:
this.addJavascriptInterface(new MyBridge(pContext), "bridge");
This should work (using it yourself). If you do not want to use the "OK" button, you will have to change the code a little according to your needs, perhaps the "onKeyPress" function of the text fields is called.
source share