开发者

Webview not displaying Twitter on some Droids

开发者 https://www.devze.com 2023-03-19 01:57 出处:网络
This i开发者_如何学Gos an obscure, possibly hardware dependent error. I have a webview that is trying to display a twitter feed like this: http://twitter.com/HP

This i开发者_如何学Gos an obscure, possibly hardware dependent error.

I have a webview that is trying to display a twitter feed like this: http://twitter.com/HP

The view works fine on a Droid 2, but fails on Droid and Droid X.

Instead of displaying the page, it just displays the twitter logo and hangs forever.

about the devices:

All running the same software, and Android 2.2. However, they are running different flavors of Android 2.2. Droid X: 2.2.1 Droid 1: 2.2.2 Droid 2: 2.2

It seems that Verizon must have added a bug or fixed a bug in their later versions of 2.2.


This is the answer:

add this:

        webView.getSettings().setDomStorageEnabled(true);

(plus use code from here: http://www.codelark.com/2010/09/13/backwards-compatibility-in-android-using-reflection/)

I have no idea why, but if you ever see an error message like this: Web Console: Uncaught TypeError: Cannot read property 'profile' of undefined then try adding this setting.

0

精彩评论

暂无评论...
验证码 换一张
取 消