Java tutorial
//package com.java2s; //License from project: Apache License import android.view.animation.AlphaAnimation; import android.view.animation.AnimationSet; public class Main { public static AnimationSet flash(final android.view.animation.Animation.AnimationListener animationlistener) { final AnimationSet animationset = new AnimationSet(true); final AlphaAnimation alphaanimation = new AlphaAnimation(0F, 1F); alphaanimation.setStartOffset(500L); alphaanimation.setDuration(100L); animationset.addAnimation(alphaanimation); final AlphaAnimation alphaanimation1 = new AlphaAnimation(1F, 0F); alphaanimation1.setDuration(100L); alphaanimation1.setStartOffset(1200L); animationset.addAnimation(alphaanimation1); animationset.setAnimationListener(animationlistener); return animationset; } }