动画可绘制不是“停止”。当我单击另一个按钮时,我想重置可绘制动画。
启动动画drawable的代码:
主要活动:
private AnimationDrawable frameAnimation
iconConnecting.setBackgroundResource(R.drawable.frame_animation);
frameAnimation = (AnimationDrawable) iconConnecting.getBackground();
frameAnimation.start();
frame_animation.xml:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/connecting0" android:duration="400" />
<item android:drawable="@drawable/connecting1" android:duration="400" />
<item android:drawable="@drawable/connecting2" android:duration="400" />
<item android:drawable="@drawable/connecting3" android:duration="400" />
<item android:drawable="@drawable/connecting4" android:duration="400" />
</animation-list>