views:

237

answers:

2

I'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.

alert(localStorage); just hang on v1.5 while on v2.0.1 it alerts correctly.

is there an unblocking way to do it or to detect the version of Android with javascript?

A: 

I believe it is possible to overload the alert handler in a WebView. I would write my own based on an alert dialog and see if that works better than the default.

Jim Blackler
Specifically, this is handled by `WebChromeClient` and `onJsAlert()`.
CommonsWare
the problem is not with Alert, but the general "javascript hang" when I try to use an unsupported javascript function.
Sirber
A: 

I can get the Android version from navigator.userAgent though

Sirber