Code example for Animation

Methods: setAnimationListener, setRepeatCount

0
        removeFrom(mItem);
        mItem = null;
    } 
 
    public void removeFrom(final MenuItem item) {
        mAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override 
            public void onAnimationStart(Animation animation) {
            } 
 
            @Override 
            public void onAnimationEnd(Animation animation) {
                clearAnimation();
                item.setActionView(null);
            } 
 
            @Override 
            public void onAnimationRepeat(Animation animation) {
            } 
        }); 
        mAnimation.setRepeatCount(0);
    } 
 
    protected void setupAnimation() { 
        if (mAnimation == null) {
            mAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.clockwise_refresh);