Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main { public static Animation fadeOutView(Context context, long duration) { Animation a = animateView(context, android.R.anim.fade_out); a.setDuration(duration); return a; } public static Animation animateView(Context context, int animationResource) { Animation a = AnimationUtils.loadAnimation(context, animationResource); return a; } }