This is because such links trigger opening of popups (new tabs, if you are in a browser). By default, opening of popup windows is disabled in WebView. Check out http://developer.android.com/reference/android/webkit/WebSettings.html#setSupportMultipleWindows(boolean)
You have to set WebChromeClient for your main WebView, and then provide an empty new WebView which will serve for opening the contents of the popup.
This is the essence of what you need to do:
webView.getSettings().setSupportMultipleWindows(true);
webView.setWebChromeClient(new WebChromeClient {
@Override
public boolean onCreateWindow(WebView view, boolean isDialog,
boolean isUserGesture, Message resultMsg) {
// Create a WebView
WebView popupWebView = new WebView(view.getContext());
// TODO: Put WebView into your view hierarchy, if needed.
//
// This is needed to open the url in the WebView.
// Without the client, WebView will try to start a browser.
popupWebView.setWebViewClient(new WebViewClient());
WebView.WebViewTransport transport =
(WebView.WebViewTransport) resultMsg.obj;
transport.setWebView(popupWebView);
resultMsg.sendToTarget();
return true;
}
});
This answer contains more code that is needed if you also want to handle closing of your popup windows: How to handle facebook like with confirm in android webview
BTW, it is not necessary to override shouldOverrideUrlLoading
if you just want to open links inside your WebView, simply setting WebViewClient is enough:
webView.setWebViewClient(new WebViewClient());