Android examples for Animation:Alpha Fly Animation
Create Alpha Animation with Animation Listener
//package com.java2s; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; public class Main { public static Animation getAplahaAnimation() { final Animation aplhaanimation = new AlphaAnimation(1.0f, 0.2f); aplhaanimation.setDuration(2000); aplhaanimation.setAnimationListener(new AnimationListener() { public void onAnimationEnd(Animation arg0) { aplhaanimation.setFillAfter(false); }// w w w. j av a 2 s .c om public void onAnimationRepeat(Animation arg0) { } public void onAnimationStart(Animation arg0) { } }); return (aplhaanimation); } }