●main.xml ------------------------------------------------------------- ●Javaソース(AnimationAndroidSample.java) package anim.rotateAnimationDemo; /* 参考サイト * http://techbooster.jpn.org/application/1680/#more-1680 */ import android.app.Activity; import android.os.Bundle; import android.view.animation.RotateAnimation; import android.widget.ImageView; public class AnimationAndroidSample extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView img = (ImageView) findViewById(R.id.img); // imgの中心を軸に、0度から360度にかけて回転 RotateAnimation rotate = new RotateAnimation(0, 360, img.getWidth() / 2, img.getHeight() / 2); rotate.setDuration(3000); // 3000msかけてアニメーションする img.startAnimation(rotate); // アニメーション適用 } }