问题加载mobile.twitter在web视图 [英] Problems loading mobile.twitter in webview

查看:127
本文介绍了问题加载mobile.twitter在web视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试加载以下URL在web视图我得到的是黑色的微博背景加载微调。在页面加载,如 WebViewClient.onPageFinished 被调用。然而,网页加载确定的标准Android浏览器。

When I try to load the following urls in a Webview all i get is black twitter background with loading spinner. The page is loaded, as WebViewClient.onPageFinished is called. However the page loads ok in the standard Android browser.

https://twitter.com/#!/scottyab or https://mobile.twitter.com/#!/scottyab

我想微博改变了他们的移动网站,因为这工作了一个月前。任何人遇到此?

I'm thinking Twitter changed their mobile website as this worked a month or so ago. Anyone else experiencing this?

更新时间:启用javascript mWebView.getSettings()setJavaScriptEnabled(真);

Updated: javascript enabled mWebView.getSettings().setJavaScriptEnabled(true);

推荐答案

通过硬编码的用户​​代理iPhone的用户代理修正了加载问题(我发现它的工作对iPhone版本的应用程序的)

Fixed the loading issue by hardcoding the user agent to iPhone's user agent (I found it worked on the iPhone version of the app)

mWebView.getSettings().setUserAgentString("Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3");

这需要一个肮脏的黑客后,洗我的手。

Need to wash my hands after this a dirty hack.

这篇关于问题加载mobile.twitter在web视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆