Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webview not displaying Twitter on some Droids

This is 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.

like image 994
gregm Avatar asked Jul 08 '11 13:07

gregm


1 Answers

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.

like image 160
gregm Avatar answered Oct 23 '22 20:10

gregm