LiveWallpaper: added proper support for attach to and detach from window on Android 2.x