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
WebViewusing aWebViewClient. The method you want isshouldOverrideUrlLoading(). This allows you to perform your own action when a particular URL is selected.You set the
WebViewClientof yourWebViewusing thesetWebViewClient()method.