2016-11-16 63 views
0

我試圖在完成此動畫後放置showdialog。當我點擊按鈕時,showdialog打開,但我想在完成動畫後打開showdialog。 看我的動畫代碼:Showdialog Android Studio

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  

}  
} 

謝謝

回答

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 

} 
});