Java tutorial
//package com.java2s; import android.animation.Animator; public class Main { /** * Cancels an animation ensuring that if it has listeners, onCancel and onEnd * are not called. */ public static void cancelAnimationWithoutCallbacks(Animator animator) { if (animator != null) { animator.removeAllListeners(); animator.cancel(); } } }