画像付きの AnimationDrawable を使ってアニメーションを作ってみました。でも2回繰り返したら止めたい。これどうやってするの?これが私のコードです。
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
imageViewCark.setBackgroundResource(R.drawable.anim);
animation = (AnimationDrawable) imageViewCark.getBackground();
if(hasFocus == true){
animation.start();
}else{
imageViewCark.setVisibility(ImageView.VISIBLE);
animation.stop();
}
}