Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; public class Main { public static void hidden(Context context, View view, int resAnimId) { if (view.getVisibility() == View.VISIBLE) { view.startAnimation(loadAnimation(context, resAnimId)); view.setVisibility(View.GONE); } } public static Animation loadAnimation(Context context, int id) { Animation myAnimation = AnimationUtils.loadAnimation(context, id); return myAnimation; } }