I have a ViewFlipper with 3 views each one display a different Layout , each child have a next button.
when clicked it animated the transition to the other child using "ViewFlipper" . What i want when the user click a button an animation starts i want to disable all button to prevent Animation collision . what i faced when i click multiple time very fast on a button i restart the animation over .
what i have tried so far
now by connection all animtion object to one Listener and 
keep a boolean falg to indicate if an animation is running or not . and in the onTouchEvent() of the Activity if the flag is true i return true else i return the super method.
this flag set to true in the onAnimationStart callback and set to false in onAnimationEnd didnt work.
and when i log the method calls it shows that onAnimationEnd called before the animation ends completely. 
Any suggestion to solve this problem ??
code
public class CreateNewKhtmehActivity extends FragmentActivity implements
        OnClickListener, AnimationListener {    
    AtomicBoolean isAnimationPlaying = new AtomicBoolean(false);
    // phase 1
    Button phase1_continue_button;
    // phase 2      
    Button phase2_continue_button;
    // phase 3
    Button phase3_start_session;
    /** Called when the activity is first created. */
    ViewFlipper flipper;
    Animation flip_in_from_left, flip_in_from_right, flip_out_to_left,
            flip_out_to_right, stay_still;
    RelativeLayout phase1;
    RelativeLayout phase2;
    RelativeLayout phase3;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.create_new_session);
        /*
         * 
         * phase 1
         */
        phase1 = (RelativeLayout) findViewById(R.id.phase1);
        setUpUIForPhase1(phase1);
        // phase2
        phase2 = (RelativeLayout) findViewById(R.id.phase2);
        setUpUIForPhase2(phase2);
        // phase 3
        phase3 = (RelativeLayout) findViewById(R.id.phase3);
        setUpUIForPhase3(phase3);
        /*
         * Animation
         */
        flipper = (ViewFlipper) findViewById(R.id.main_flipper);
        flipper.setDrawingCacheEnabled(true);
        flipper.setDisplayedChild(2);
        flip_in_from_left = AnimationUtils.loadAnimation(
                getApplicationContext(), R.anim.push_in_from_left);
        flip_in_from_left.setAnimationListener(this);
        flip_in_from_right = AnimationUtils.loadAnimation(
                getApplicationContext(), R.anim.push_in_from_right);
        flip_in_from_right.setAnimationListener(this);
        flip_out_to_left = AnimationUtils.loadAnimation(
                getApplicationContext(), R.anim.push_out_to_left);
        flip_out_to_left.setAnimationListener(this);
        flip_out_to_right = AnimationUtils.loadAnimation(
                getApplicationContext(), R.anim.push_out_to_right);
        flip_out_to_right.setAnimationListener(this);
        stay_still = AnimationUtils.loadAnimation(getApplicationContext(),
                R.anim.stay_still);
        stay_still.setAnimationListener(this);
    }
    private void setUpUIForPhase3(View v) {
        phase3_start_session = (Button) v
                .findViewById(R.id.start_session_button);
        phase3_start_session.setOnClickListener(this);
     }
    private void setUpUIForPhase2(View v) {
        phase2_continue_button = (Button) v
                .findViewById(R.id.phase2_continue_button);
        phase2_continue_button.setOnClickListener(this);
    }
    private void setUpUIForPhase1(View v) {
        phase1_continue_button = (Button) phase1
                .findViewById(R.id.phase1_continue_Button);
        phase1_continue_button.setOnClickListener(this);
    }
    public void onBackPressed() {
        int currentChild = flipper.getDisplayedChild();
        switch (currentChild) {
        // first displayed child
        case 0:
            flipNext();
            if (this.move_from_phase1_to_phase3) {
                flipper.setDisplayedChild(2);
            } else {
                spinner_from.invalidate();
                spinner_to.invalidate();
                flipper.setDisplayedChild(1);
            }
            break;
        case 1:
            flipNext();
            flipper.setDisplayedChild(2);
            break;
        default:
            super.onBackPressed();
        }
    }
    public void onClick(View v) {
        System.out.println("onClick");
        switch (v.getId()) {
        case R.id.phase1_continue_Button:
            spinner_from.invalidate();
            spinner_to.invalidate();
            flipPrevious();
            if (this.move_from_phase1_to_phase3) {
                flipper.setDisplayedChild(0);
            } else {
                flipper.setDisplayedChild(1);
            }
            break;
        case R.id.phase2_continue_button:
            flipPrevious();
            flipper.setDisplayedChild(0);
            break;
        case R.id.start_session_button:
            insetNewSession();
            break;
        }
    }
    // Methods concerning the flip
    public void flipNext() {
        flipper.setInAnimation(flip_in_from_right);
        flipper.setOutAnimation(flip_out_to_left);
    }
    public void flipPrevious() {
        flipper.setInAnimation(flip_in_from_left);
        flipper.setOutAnimation(flip_out_to_right);
    }
    public void stayStill() {
        flipper.setInAnimation(stay_still);
        flipper.setOutAnimation(stay_still);
    }
     .......
     ........
     @Override
     public boolean onTouchEvent(MotionEvent event) {
     System.out.println("isAnimationPlaying " + isAnimationPlaying.get());
     if (isAnimationPlaying.get()) {
     return true;
     } else {
     return super.onTouchEvent(event);
     }
    // }
    public void onAnimationEnd(Animation animation) {
        System.out.println("onAnimationEnd");
            isAnimationPlaying.set(true);
    }
    public void onAnimationRepeat(Animation animation) {
        System.out.println("onAnimationRepeat");
    }
    public void onAnimationStart(Animation animation) {
        System.out.println("onAnimationStart");
        isAnimationPlaying.set(false);
    }
}
 
    