@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); attachedToWindow = true; }