/res/anim/spin.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<set>
<rotate
android:fromDegrees="0"
android:toDegrees="-1440"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000"/>
</set>
</set>
activity.java
imgV= (ImageView) findViewById(R.id.imageView1);
imgV.setImageResource(R.drawable.juggle);
Animation an = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.spin);
imgV.startAnimation(an);
/res/menu/speed.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/start"
android:title="start"
android:orderInCategory="1"/>
<item
android:id="@+id/stop"
android:title="stop"
android:orderInCategory="2"/>
<item
android:id="@+id/cancel"
android:title="cancel"
android:orderInCategory="3"/>
<item
android:id="@+id/delete"
android:title="delete"
android:orderInCategory="4"/>
</menu>
MainActivity.java 重写 activity onCreateOptionsMenu方法
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.speed, menu);
return true;
}