一、在drawable中创建animal
<<span style="color:#000080;font-weight:bold;">set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="5000">
<<span style="color:#000080;font-weight:bold;">rotate android:fromDegrees="0" android:toDegrees="360" />
</<span style="color:#000080;font-weight:bold;">set>
二、Activity中
Animation animation = AnimationUtils.loadAnimation(this, R.anim.heheda);
//给图片设置动画
mImage.setAnimation(animation);
//开启动画
animation.start();
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
Intent intent = new Intent(MainActivity.this, MainActivity2.class);
startActivity(intent);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});