@Override protected void onDetachedFromWindow() { if (animator != null) { // If we're animated, stop the animation animator.stop(); } super.onDetachedFromWindow(); }
@Override protected void onAttachedToWindow() { if (animator != null) { // If we're animated, start the animation animator.start(); } super.onAttachedToWindow(); }