stop()
stops the animation and thatβs it. Since stop () is an AnimationDrawable.class
method, you can use it when you want to stop AnimationDrawable
animation, but not in any view.
clearAnimation()
is a method of the View.class
class. This will stop the viewing animation and additionally:
If there is an AnimationListener
defined, AnimationListener.onAnimationEnd(Animation animation)
will be called.
If defined Handler
Handler.postAtFrontOfQueue(Runnable r)
.
Here is the call hierarchy: View.clearAnimation()
Animation.detach()
Animation.fireAnimationEnd()
and the fireAnimationEnd()
method:
private void fireAnimationEnd() { if (mListener != null) { if (mListenerHandler == null) mListener.onAnimationEnd(this); else mListenerHandler.postAtFrontOfQueue(mOnEnd); } }
source share