Issue
I am developing a android application, Within the application I am trying to Load a URL using WEBVIEW. Afer i submit the data in the opened webpage, it gets redirected to some other URL. My requirement is to get the complete Redirected URL within my android application.
I didnt see any events/ API methods which can be used to notify URL Redirect.
Are there any way to listen for URL redirects within my application and then retrieve the URL.
Solution
you can identify the redirection using webClient just set webclient on your webview
like below
myWebView.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
//do your stuff here
if(url.equalsIgnoreCase("your redirect url "))
{
return false;
}
return true;
}
});
Answered By - Damodhar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.