How to force WebView
to open all the urls inside the application?
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 yourWebView
, usingsetWebViewClient()
. 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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With