Android examples for User Interface:View Hide Show
show View With Animation
//package com.java2s; import android.app.Activity; import android.support.annotation.AnimRes; import android.view.View; import android.view.animation.AnimationUtils; public class Main { public static void showViewWithAnim(final View view, @AnimRes final int anim, final int delay) { new Thread(new Runnable() { @Override/*from w ww .j a va 2 s. com*/ public void run() { sleep(delay); ((Activity) view.getContext()) .runOnUiThread(new Runnable() { @Override public void run() { view.setVisibility(View.VISIBLE); view.startAnimation(AnimationUtils .loadAnimation(view.getContext(), anim)); } }); } }).start(); } private static void sleep(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } }