Make URL open in the same Activity

6

I'm creating a WebView for Android. When I load the App, the imported page works fine, but when I click on some link of the page, that same link opens in another browser.

asked by Kaleb Figueiredo 18.08.2014 в 15:50

1 answer

7

Set a WebViewClient in your WebView to handle URLs:

wv.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return false;
    }
});
    
18.08.2014 / 16:39