Java tutorial
//package com.java2s; import android.content.Context; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main { public static void animateView(Context context, View view, int resAnimId, long duration) { Animation a = AnimationUtils.loadAnimation(context, resAnimId); a.setDuration(duration); view.startAnimation(a); } }