Question

I am passing a url into my application and calling loadUrl on a CordovaWebView. Anytime I try with an external URL it opens the link in an external browser application. I need it to remain in my application.

myCordovaWebView.loadUrl("http://google.com");
Was it helpful?

Solution

myCordovaWebView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
          view.loadUrl(url);
          return true;
           }}); 
myCordovaWebView.loadUrl("http://google.com");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top