Android -- How to destroy an object after its animation has stopped?
After an ImageView translates off开发者_StackOverflow社区 the screen via a TranslateAnimation object, I want to set the ImageView as null. So really my question is how does one know when an animation has completed without resorting to polling to objects position or other variables?
Register an AnimationListener
with the Animation
, and listen for onAnimationEnd()
.
精彩评论