I got to a dead loop in Android webview application with backkey while dealing with redirect links.
For example, when my webview started, it goes to link0.
In l
shouldOverrideUrlLoading()
is called on a per-URL basis. So, if http://site1.com/ redirects to http://site2.com/, which then redirects to http://site3.com/, you are calling WebView.loadUrl()
for each of these URL's. Thus each appears in the back stack.
Instead of creating a WebViewClient
you probably want a WebChromeClient
. WebChromeClient
defines a method onCreateWindow
that is only invoked when the WebView
is trying to create a new window, not for every single URL it accesses.