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 汪杰 阅读(2124) 评论(0)  编辑 收藏 引用 所属分类: Java
只有注册用户登录后才能发表评论。

<2009年3月>
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 384891
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜