I'm trying to do something simple, but I can't understand why it's not working.
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.
Here is the animation xml:
<rotate android:interpolator="@android:anim/decelerate_interpolator"
android:fromDegrees="-45"
android:toDegrees="-10"
android:pivotX="90%"
android:pivotY="10%"
android:repeatCount="3"
android:fillAfter="false"
android:duration="10000" />
And this is the code I use to call it:
public void onCreate( Bundle savedInstanceState )
{
final ImageView ib = (ImageView)this.findViewById( R.id.photo );
ib.setOnClickListener( new OnClickListener( ) {
@Override
public void onClick( View v )
{
Animation hang_fall = AnimationUtils.loadAnimation( Curriculum.this, R.anim.hang_fall );
v.startAnimation( hang_fall );
Intent i = new Intent( ThisActivity.this, NextActivity.class );
ThisActivity.this.startActivity( i );
}// end onClick
} );
}// end onCreate
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?