Android – Open target _blank links in WebView with external browser

After visiting the above links, I come up with this code and hope this helps.

wv.setWebChromeClient(new WebChromeClient() {
    public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, android.os.Message resultMsg)
        WebView.HitTestResult result = view.getHitTestResult();
        String data = result.getExtra();
        Context context = view.getContext();
        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(data));
        return false;

Leave a Comment