Proper support for onAttachedToWindow and onDetachedFromWindow methods on Android 2.x