How can I call a simple event or execute a JavaScript function in native Android code with Cordova?
I tried
public void notificationRecieved(String heading,String news){
try{
if(webview!=null){
Log.i("PUSHPARSE","in Notification Received Event");
//webview.loadUrl("javascript:alert('URLcall')");
webview.sendJavascript("alert('CAlling from Java')");
}
}catch(Exception e1){
Log.e("PUSHPARSE",e1.getMessage(),e1);
}
}
I am not able to get any notification or alert.
Update
Logcat shows I/PUSHPARSE( 2039): in Notification Received Event
Tried doing
webview.loadUrl("http://www.google.com");
the logs show
>>> loadUrl(http://www.google.com)
W/CordovaWebView( 2039): CordovaWebView.init() was not called. This will soon be required.
D/CordovaWebView( 2039): CordovaWebView is running on device made by: unknown