When I'm loading a resource in a WebView, in Android, I simply call the typical mWebView.loadUrl(ht);
.
The problem is that I would like to check the final url, and to perform some operation, when all the redirects are finished to be followed.
I mean: if I load example.com/page1
, and this returns a 302 code that leads to another page (let's say, /page2
), and this leads me again via a 302 redirection to another page (/page3
), and this finally gives me a 200 and stops there, I would like to know when this happens.
It looks like I don't have the possibility to check the response code, nor the headers, and onPageFinished
as well as shouldOverrideUrl
are called for each redirect. It's kinda like "stateless"...
How can I distinguish between a typical 302 redirect, and the actual end of the loading process (200)?