Support for Android API 10; isAttachedToWindow() requires API 19, solved that with an workaround