Skip to content Skip to sidebar Skip to footer

Android: How Can I Stop An Infinite Animation Applied On An Imageview?

I have an ImageView on which I have applied a rotate animation. Since I want the rotation to go on continuously, I gave the repeatCount as infinite in my rotate.xml: android:repeat

Solution 1:

Use clearAnimation() to stop an animation. There is no loadAnimation() on View.

Solution 2:

You can also call anim.cancel(); but you should also call anim.reset(); immediately after it. Then when you want to start it again, just call startAnimation on the view.

Solution 3:

Post a Comment for "Android: How Can I Stop An Infinite Animation Applied On An Imageview?"