0

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.

2
  • Hi. I've never made an Android plugin, but this post may help you : stackoverflow.com/questions/16404492/… Commented Jun 18, 2013 at 7:54
  • @gaepi hi, since it's only one line of code originating in the Java layer itself, I was hoping that a plugin wasn't necessary. Ill take a look anyways. Thanks. Commented Jun 18, 2013 at 12:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.