(Question answered in the comments. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
@CommonsWare wrote:
Have you tried using the HttpClient classes? This error feels like it is coming perhaps from HttpUrlConnection
.
You might consider switching to HttpClient, since that is built into Android and is Google's recommended choice for HTTP requests. I think there are ways you can have finer-grained control over how it handles redirects, though I have not run into your specific problem yet and therefore do not know whether it will help in your case.
The OP wrote:
I use a factory method for parsing xml of RSS feeds, here is its code URL url = new URL(urlString); InputSource inputSource = new InputSource(url.openStream());
This code is further used to Document (org.w3c.Document)
Parsing.
Thanks, your suggestion is worked with little bit of tweaking in code. I have applied that tweaking in my centralized method and it worked like a charm.