I have a webview with a banner and when I click on the banner there should open a second webview that follows the link. How can I do that? I have created the first WebView and it shows my banner but when I click on it, it opens the link in the same WebView.
How can I catch any events in the WebView when I click on a link that it should do something (with that link)? Just like shouldStartLoadWithRequest
in iPhone.
Thank you,
Wouter
You can monitor events in a WebView
using a WebViewClient
. The method you want is shouldOverrideUrlLoading()
. This allows you to perform your own action when a particular URL is selected.
You set the WebViewClient
of your WebView
using the setWebViewClient()
method.
shouldOverrideUrlLoading
good method, but if you click on current
link webview
client not calling to shouldOverrideUrlLoading
method.
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