Android examples for Animation:Fade Animation
Create fade Out Animation and set duration
//package com.java2s; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; public class Main { public static Animation fadeOut( final android.view.animation.Animation.AnimationListener animationlistener) { final AlphaAnimation alphaanimation = new AlphaAnimation(1F, 0F); alphaanimation.setDuration(300L); alphaanimation.setInterpolator(new LinearInterpolator()); alphaanimation.setAnimationListener(animationlistener); return alphaanimation; }//from w w w . j av a 2 s. co m }