3

I am trying to allow user to login into our application through a WebView, but when trying to login, I get an error saying ERR_TOO_MANY_REDIRECTS. The login protocol consists of 5 redirects, but we have no control over it.

It works in a web browser, but Anroid WebView starts thinking we are in a redirect loop and cancels the whole thing. Up until API 8 there was a function onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg), which allowed you to continue, but is now not used anymore.

What can I do to get around this problem?

Luka
  • 405
  • 1
  • 7
  • 18

1 Answers1

3

In my code I have the following line:

webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

Just deleting this line solve the issue.

4b0
  • 20,627
  • 30
  • 92
  • 137
Petros Mosoyan
  • 218
  • 2
  • 13