Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make links load or refresh within a webview in android?

Tags:

android

when i load a url in a webview. it loads perfectly.

but i touch anything in that webview its redirected to the browser by default.

how to set that link will load in the same webview itself.

thanks.

like image 798
Praveen Avatar asked Dec 20 '25 04:12

Praveen


1 Answers

Implement a WebViewClient, overriding shouldOverrideUrlLoading() to tell Android what you want to do on link clicks. Attach that WebViewClient to the WebView via setWebViewClient().

like image 192
CommonsWare Avatar answered Dec 22 '25 19:12

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!