1

有什么方法可以知道在 webview 中加载的 url 是否redirecting指向任何其他页面?

E.g

  I have an Edittext where I search for "car" .Now , result page for "car" is 
 loaded in the webview below. In the result page , I click for wikipedia link.
 There, First url loaded is "https://en.wikipedia.org/wiki/Automobile" which 
  automatically gets redirected to "https://en.m.wikipedia.org/wiki/Automobile".
 I want to know this redirection.

Actually , I want to find whether the url loaded in webview is redirecting or not.
 If it's redirecting ,then,I want to capture it and take some actions.

提前谢谢你。任何帮助都会很棒。

4

1 回答 1

4

是的,看看WebViewClient.onPageStarted()。调用时(在每次重定向时),您可以通过 view 参数获取 url WebView:view. getUrl().

于 2013-07-23T16:51:50.293 回答