animation3.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationEnd(Animation arg0) { params = new LayoutParams(0, 0); params.height = 50; params.width = 50; params.setMargins(125, 0, 0, 0); buttonMusic.setLayoutParams(params); buttonMusic.clearAnimation(); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } });