Jack Jack - 2 months ago 10
Android Question

Open a link on WebView

I am using WebView on my application.
the WebView contains a web site with link.
When I am clicking on the link, it is open the link on the application(By webView).
How can I open the link with the browser?
Thank you!

Answer

Try something like this

new Intent(Intent.ACTION_VIEW, Uri.parse(url)));

or if you need to override Webview link click use this

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    view.loadUrl(url);
    return true;

This should do the trick