Im using Cordova-Android (PhoneGap). I'm extending the CordovaWebViewClient
class, overriding the shouldOverrideUrlLoading
method. I need to send some javascript to the view. I've tried this, but it doesn't work:
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (isNetworkAvailable()) {
sendJavascript("javascript:alert('OK')");
return false;
} else {
sendJavascript("javascript:alert('NO')");
return true;
}
}
What am I doing wrong? Any help?
Thanks in advance.