Android examples for User Interface:View Animation
start View Animation
//package com.java2s; import android.graphics.drawable.AnimationDrawable; import android.view.View; import android.view.animation.Animation; public class Main { private Animation animation; public void startAnimation(View view) { view.startAnimation(animation);/* w w w . j a va2s.c o m*/ } public static void startAnimation(int resId, View view) { view.setBackgroundResource(resId); ((AnimationDrawable) view.getBackground()).start(); } }