Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main { /** * Load anim and set duration * * @param anim * @param duration * @return */ public static Animation loadAnimation(Context context, int anim, int duration) { Animation animation = AnimationUtils.loadAnimation(context, anim); animation.setDuration(duration); return animation; } }