I have 3 image view in which i started same animation (translate)
I have animation listener, in onAnimationEnd(Animation animation) method,
I want to know on which image view the animation is ended..?
From animation object how can I know in which it was started..?
Thanks in advance..!
Well you can not know what is the object on which the animation ended. The whole purpose of the AnimationListener is to listen to the Animation and not to the object.
Solution
1- Create your own Animation class and save in it a reference to the object which is animating.
This will allow you to cast the Animation to YourAnimation in the function
onAnimationEndand get the reference.2- A simpler solution is to create your own AnimationListener that holds a reference of the Object that is animated.
For example:
So when you want to animate your ImageView: You do the following: