I have a TranslateAnimation
on my class. The animation starts automatically.
I set button that if it is clicked, the animation will be canceled (animation.cancel();
).
I also set an AnimationListener for my class. If my animation ends, I will start a new Activity (you go to the menu).
public void onAnimationEnd(Animation animation) {
startActivity(new Intent(Class.this, Class2.class));
}
My app is relying on that the user has to click the button before the animation ends.
The problem is that animation.cancel();
is admitted as the end of the animation.
How to cancel the animation in the other way that was not counted as the end of the animation? Is that possible?
Thanks in advance!