Android examples for User Interface:View Animation
Runs the given animation on the given view.
import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main{ public static void runAnimation(final int pAnimationId, final View pView) { if (AndroidUtils.isUIThread()) { Animation anim = AnimationUtils.loadAnimation( pView.getContext(), pAnimationId); pView.startAnimation(anim);// w ww. j a va 2 s . c om } else { pView.post(new Runnable() { public void run() { runAnimation(pAnimationId, pView); } }); } } }