asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0

After some research I conclude that despite what most of the tutorials out there say, shouldOverrideUrlLoading() does not get called when:

  1. You load a URL like

    loadUrl("http://www.google.com");
  2. The browser redirects the user automatically via an HTTP Redirect.

It does however, get called when you you click on a link inside a webpage inside the webview. IIRC the twitter authorization uses an HTTP Redirect.. Bummer, this would be helpful if it worked how all the tutorials say it does. I think this is from a very old version the Android API...

/* 
* 有些情况不会触发这个方法,所以需要在onPageStarted里进行补漏捕获
* 比如:
* webview第一次加载loadurl loadUrl("http://www.google.com");
* HTTP Redirect跳转
* 有时网页用脚本进行网页跳转(暂时忘了具体情况,待测)
* 经测location.href、location.replace、window.open进行跳转能捕获到
*/

posted on 2012-06-09 13:15 汪杰 阅读(2953) 评论(0)  编辑 收藏 引用 所属分类: Java
只有注册用户登录后才能发表评论。

<2006年8月>
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 466814
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜