For animation use something like
hideWithSlideUp = new TranslateAnimation(0, 0, 0, -displayHeight);
You might get into trouble if you want animation to be used for all apps, including Android killing your app, or a user launching a new fullscreen activity.
source
to share