set Animation Listener to Animation - Android Animation

Android examples for Animation:Animation Creation

Description

set Animation Listener to Animation

Demo Code


import android.view.animation.Animation;

public class Main{
    public static void setAnimationListener(Animation aninm,
            final AnimListener listener) {
        aninm.setAnimationListener(new Animation.AnimationListener() {
            @Override//  w w w  .  java  2s  .c o m
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                listener.onAnimFinish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
    }
}

Related Tutorials