8

How to force WebView to open all the urls inside the application?

1 Answer 1

12

You need to override the WebViewClient for your WebView.

See here for the details: it's pretty straight forward.

Notice Step 6 in particular.

To open links clicked by the user, simply provide a WebViewClient for your WebView, using setWebViewClient(). For example:

WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.setWebViewClient(new WebViewClient()); 

That's it. Now all links the user clicks load in your WebView.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.