how to call javascript from java

24 views
Skip to first unread message

sarad mohanan

unread,
Apr 17, 2014, 6:01:22 AM4/17/14
to phon...@googlegroups.com
I am new to cordova. I have created a webview from where i able to call java from by javascript. I am extending the app now. I want to dynamically update the webview and render the new feed whenever there is one available in database. In fact I want to use database listener so when ever there is a change in database it will fire a javascript call and the new feed will be rendered. how do i achieve this. I went through cordova plugin and understood that it is used for java call from javascript(correct me if I am wrong).

jcesarmobile

unread,
Apr 18, 2014, 7:52:55 AM4/18/14
to phon...@googlegroups.com
You can do it with the webview.loadUrl("javascriptString");
I think there is another way, but I don't remember right now

Rahul

unread,
Apr 19, 2014, 5:14:12 AM4/19/14
to phon...@googlegroups.com
I have used like this in my plugin - 

  webView.loadUrl("javascript:cordova.fireDocumentEvent('myeventname');


Reply all
Reply to author
Forward
0 new messages