Updated for Android 3.0 and later versions. Compatibility with previous versions is probably broken (the compatibility code is commented)