super.onCreate(savedInstanceState);
final Button button = new Button(this);
button.setBackgroundResource(R.drawable.animation_drawable_vector);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AnimationDrawable frameAnimation = (AnimationDrawable) v.getBackground();
// Start the animation (looped playback by default).
frameAnimation.start();
}
});
setContentView(button);