0
アンドロイドのアニメーションボタンに問題があります。これは私のコードです:ボタンのアニメーションは一度だけ実行できません
private void RunAnimations() {
Animation a = AnimationUtils.loadAnimation(this, R.anim.alpha);
a.reset();
Button tv = (Button) findViewById(R.id.button1);
tv.clearAnimation();
tv.startAnimation(a);}
@Override
public boolean onTouchEvent(MotionEvent event){
if(event.getAction()== MotionEvent.ACTION_DOWN){
RunAnimations();
}
return false;
}
問題は、画面がオンタッチの場合にアニメーションが実行されます。アニメーションを1回だけ実行したい。私は何を追加すべきですか?