프레임 애니메이션을 돌리다가 Stop버튼을 눌렀을 때 애니메이션이 멈추게 되면 멈추게 된 화면으로 이벤트를 처리하고 싶은데요 if문에 어떤 조건을 넣어야할 지 몰라서 질문 올립니다.
public class AnimationActivity extends Activity {
AnimationDrawable animation = null;
ImageView imageView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button startButton = (Button) findViewById(R.id.start);
Button stopButton = (Button) findViewById(R.id.stop);

startButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
startAnimaion();
}
});

stopButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
stopAnimation();
}
});
}

private void startAnimaion()
{
imageView = (ImageView) findViewById(R.id.imageview);
BitmapDrawable frame1 = (BitmapDrawable) getResources().getDrawable(R.drawable.twentypercent);
BitmapDrawable frame2 = (BitmapDrawable) getResources().getDrawable(R.drawable.tenpercent);
BitmapDrawable frame3 = (BitmapDrawable) getResources().getDrawable(R.drawable.noresult);
BitmapDrawable frame4 = (BitmapDrawable) getResources().getDrawable(R.drawable.half);

int duration = 400;
animation = new AnimationDrawable();
animation.setOneShot(false);
animation.addFrame(frame1, duration);
animation.addFrame(frame2, duration);
animation.addFrame(frame3, duration);
animation.addFrame(frame4, duration);

imageView.setBackgroundDrawable(animation);
animation.start();



}
private void stopAnimation()
{
animation.stop();
if()
{
Toast.makeText(this, "반값", Toast.LENGTH_LONG).show();
}
if()
{
Toast.makeText(this, "다음기회에", Toast.LENGTH_LONG).show();
}
if()
{
Toast.makeText(this, "10%", Toast.LENGTH_LONG).show();
}
if()
{
Toast.makeText(this, "20%", Toast.LENGTH_LONG).show();
}
}
}