我正在做一个RotateAnimation。我开始旋转图像,但我想知道动画何时完成。我怎么知道动画什么时候结束?
下面是我的旋转图像代码。

RotateAnimation rotateanimation = new RotateAnimation(StartPoint,
                    EndPoint, Animation.RELATIVE_TO_SELF, 0.5f,
                    Animation.RELATIVE_TO_SELF, 0.5f);
            rotateanimation.setDuration(1000);
            rotateanimation.setRepeatCount(0);
            rotateanimation.setRepeatMode(Animation.REVERSE);
            rotateanimation.setFillAfter(true);
            rotateImage.setAnimation(rotateanimation);
            rotateanimation.start();
            relative.invalidate();

最佳答案

Use Animation Listener as:

implements animation listener in activity
and then :
*rotateanimation.setAnimationListener(MainActivity.this);
*after that you will find on
    public void onAnimationEnd(Animation animation)
{
//Toast here on animation ends
}

http://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html

10-04 18:10