Java tutorial
//package com.java2s; //License from project: Apache License import android.view.View; import android.view.animation.AlphaAnimation; public class Main { public static void fadeToInvisible(final View view, int startOffset, int duration) { int visibility = view.getVisibility(); if (visibility != View.INVISIBLE) { AlphaAnimation anim = new AlphaAnimation(1, 0); anim.setStartOffset(startOffset); anim.setDuration(duration); view.setVisibility(View.INVISIBLE); view.startAnimation(anim); } } }