3

I have followed this answer to animate an imageview. The animation works perfect. But I had added an onClickListener to the imageview. The onClickListener works perfectly when the image is at rest, that is not animating. But while animating, the imageview doesn't trigger the onClickListener action. What is the problem here? How can I rectify it? Please help me out.

Community
  • 1
  • 1
jincy abraham
  • 579
  • 2
  • 9
  • 21
  • If it's one of the old style tween animations, then the ImageView actually is in the same spot as when at rest and it is only _drawn_ somewhere else. Try tapping on the spot that the ImageView sits while at rest, even during or after the animation. – Karakuri May 30 '14 at 05:20
  • yeah, so I need to update the layout during animation right? – jincy abraham May 30 '14 at 05:37
  • 1
    The best thing would be to learn how to use the new animation framework (`ObjectAnimator` and `ViewPropertyAnimator`). These animators will actually move the View so you don't run into things like this. See https://developer.android.com/guide/topics/graphics/prop-animation.html – Karakuri May 30 '14 at 05:39

0 Answers0