Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear animation applied to ImageView android using startAnimation

I have applied a zoom in animation to my Imageview using

myImageView.startAnimation(AnimationUtils.loadAnimation(this,R.anim.zoom_in ));

by specifying android:fillEnabled and android:fillAfter attributes of animation to true.How can I , at a later point of time clear the animation and revert my ImageView to the old state?I Tried with clearAnimation() method of ImageView but seems not to be working with fillEnabled and fillAfter attributes .

like image 761
drooooooid Avatar asked Nov 25 '11 10:11

drooooooid


2 Answers

myImageView.setAnimation(null);    

should work. Hope it helps!

like image 183
jcxavier Avatar answered Nov 14 '22 21:11

jcxavier


myImageView.clearAnimation() is what you are looking for.

like image 23
Brandon McAnsh Avatar answered Nov 14 '22 22:11

Brandon McAnsh