Android examples for User Interface:View Animation
start/stop animation
//package com.java2s; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; public class Main { /**//w w w. j ava 2 s. c o m * start/stop animation * * @param d * @param start */ static public void startDrawableAnimation(Drawable d, boolean start) { if (d instanceof AnimationDrawable) { if (start) { ((AnimationDrawable) d).start(); } else { ((AnimationDrawable) d).stop(); } } } }