/** Hide time picker */ public void hideTimer() { MainActivity me = MainActivity.this; Context context = me; Animation anim; anim = AnimationUtils.loadAnimation(context, R.anim.push_down_out); anim.setAnimationListener(me); // timePicker.setVisibility(TimePicker.VISIBLE); mTimePicker.startAnimation(anim); }