我试图在完成这个动画后放上showdialog。当我单击按钮时,showdialog打开,但我想在完成动画后打开showdialog。 看我的动画代码:
btngirar.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
angle = r.nextInt(10000) + 360;
RotateAnimation rotate = new RotateAnimation(0, angle,
RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
rotate.setFillAfter(true);
rotate.setDuration(4000);
rotate.setInterpolator(new AccelerateDecelerateInterpolator());
ivgarrafa.startAnimation(rotate); //ivgarrafa is the image that rotates
}
}
谢谢
答案 0 :(得分:1)
rotate.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
//show your dialog here
}
});