final Animation animRotate = AnimationUtils.loadAnimation(this, R.anim.anim_rotate);
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View view) {
view.startAnimation(animRotate);
}});