Android — How to destroy an object after its animation has stopped?

After an ImageView translates off 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?

Answers


Register an AnimationListener with the Animation, and listen for onAnimationEnd().


Need Your Help

Lazy evaluation not working as it should

java lazy-evaluation

I had to evaluate a boolean expression frecuently, so I converted it in a private method in it's class. Here is the code it's causing me trouble:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.