Inside my app, I was wondering if it was possible to make a certain URL in a WebView, when clicked, to redirect to a new activity view outside of the WebView?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.Alternatively, you could use a specific
Intentfilter to “hijack” particular URLs. I think if you use this approach: