Android examples for Animation:Animation Creation
Load animation and set duration
//package com.java2s; import android.content.Context; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main { /**/*from w w w .j a v a 2 s. co m*/ * 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; } }