3

How to have Android webview open links that are target “_blank” in default browser , i tried the following code but it still show all links with the webview , any one have a solution ?

 public boolean shouldOverrideUrlLoading(WebView view, String url) {
            String myAlternativeURL = "http://example.com";  
            if (!url.equals(myAlternativeURL)) {  
                {
                    Intent i = new Intent(Intent.ACTION_VIEW);
                    i.setData(Uri.parse("http://example.com"));
                    startActivity(i);
                    }
                return true;  
            } else {
            view.loadUrl(url);
            return true;
        }
        }
Dr.Mezo
  • 807
  • 3
  • 10
  • 25
  • 1
    Hey, did you solve this? I am having a [quite similar issue](http://stackoverflow.com/questions/26031620/android-webview-ignoring-target-blank-when-added-webviewclient). – MysticMagicϡ Sep 25 '14 at 07:45

0 Answers0