Animation BEFORE activity change?

That's because you're starting the intent and the animation at the same time. You need to start the intent after the animation is over, like this: Override public void onClick( View v ) { Animation hang_fall = AnimationUtils. LoadAnimation( Curriculum.

This, R.anim. Hang_fall ); hang_fall. SetAnimationListener(new Animation.

AnimationListener() { public void onAnimationEnd(Animation animation) { Intent I = new Intent( ThisActivity. This, NextActivity. Class ); ThisActivity.this.

StartActivity( I ); } public void onAnimationRepeat(Animation animation) { // Do nothing! } public void onAnimationStart(Animation animation) { // Do nothing! } }); v.

StartAnimation( hang_fall ); }// end onClick.

That's because you're starting the intent and the animation at the same time. You need to start the intent after the animation is over, like this: @Override public void onClick( View v ) { Animation hang_fall = AnimationUtils. LoadAnimation( Curriculum.

This, R.anim. Hang_fall ); hang_fall. SetAnimationListener(new Animation.

AnimationListener() { public void onAnimationEnd(Animation animation) { Intent I = new Intent( ThisActivity. This, NextActivity. Class ); ThisActivity.this.

StartActivity( I ); } public void onAnimationRepeat(Animation animation) { // Do nothing! } public void onAnimationStart(Animation animation) { // Do nothing! } }); v.

StartAnimation( hang_fall ); }// end onClick.

Worked as a treat, thanks! I wish there was a little more documentation on some of this matters. :) – Stephan Dec 1 '10 at 9:06 developer.android.Com/reference/packages.

Html is the best reference there is. Just search for any classes you want to know how to use. – CaseyB Dec 1 '10 at 14:01.

What I'm trying to do is: when I touch an ImageView, it will show an animation on it. And then, only when that animation ends it will start the new activity. Instead, what happens is that the new activity starts right away and the animation is not shown.

As you see I tried putting a loooong time for the animation, but it doesn't work. The NextActivity starts right away, it doesn't wait for the animation in ThisActivity to finish. Any idea on why this happens?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions