I have a WebView and I load a web page in to it. I want to choose which link’s on that page should open in WebView and which should open in Android browser. I can make them all open in WebView by using WebViewClient and overriding shouldOverrideUrlLoading(…).
I have tried something like:
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.toLowerCase().contains("yahoo.com")) {
return false;
} else {
view.loadUrl(url);
return true;
}
}
,but that is not working. Any Ideas how to do this ?
The documentation is not completely clear:
I’m assuming
WebViewClientrefers to theWebView viewparameter.I would try returning true and firing a new intent to handle the url.