Skip to content Skip to sidebar Skip to footer

Animation On Removeallviews Android

I have a class where I include another layout on a button click. This included layout has some buttons and a code which executes on clicking these buttons. I have used a counter

Solution 1:

The answer is pretty simple. You have to remove the view after the animation is finished. This can be achieved pretty simple, first you have to set an animation listener for your animation and in the onAnimationEnd callback - which is called when the animation is finished - you remove the views.

EDIT:

Replace this:

flContainer.removeAllViews();
flContainer.startAnimation(slideup);

With this:

slideup.setAnimationListener(newAnimation.AnimationListener() {
    @OverridepublicvoidonAnimationStart(Animation animation) {

    }

    @OverridepublicvoidonAnimationEnd(Animation animation) {
        flContainer.removeAllViews();
    }

    @OverridepublicvoidonAnimationRepeat(Animation animation) {

    }
});
flContainer.startAnimation(slideup);

If there are any further problems let me know.

Post a Comment for "Animation On Removeallviews Android"