I want to apply an animation to a view and show it when the animation has ended through a AnimationListener. My code works for devices 4.x but it's not working for a 2.3.3 device, the onAnimationStart and onAnimationEnd methods are never called.
final Animation toTopAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.move_up);
toTopAnimation.setDuration(250);
toTopAnimation.setFillBefore(true);
toTopAnimation.setFillAfter(true);
toTopAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.i("log", "onAnimationStart");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.i("log", "onAnimationEnd");
mQuickReturnView.setVisibility (View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
mQuickReturnView.setAnimation(toTopAnimation);
mQuickReturnView.startAnimation(toTopAnimation);
Can you see anything wrong?
Thanks