title: Android: No Animation is played (several buttons implementing the same animation effect)
body: <p>I would like to apply the same alphaanimation for button A, B and C, and therefore implemented the following codes:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) 
  {
      animation = new MutableAlphaAnimation();
      animation.setAnimationListener(this);   
  
      btn_A.setOnClickListener(new OnClickListener() 
      {         
          public void onClick(View v) 
          {                           
              animation.setResetBlocked(true);
              btn_A.setAnimation(animation);
              animation.setResetBlocked(false);
              animation.start(0.0f, 0.5f, FADE_IN_DURATION);
              btn_A.invalidate();
          }  
      }); 
  }
  
  public class MutableAlphaAnimation extends Animation 
      {
          private float mFromAlpha;
          private float mToAlpha;
          private boolean resetBlocked;
  
          public MutableAlphaAnimation() 
          {
          }
  
          public void start(float fromAlpha, float toAlpha, long duration) 
          {
              mFromAlpha = fromAlpha;
              mToAlpha = toAlpha;
              setDuration(duration);
              setStartTime(START_ON_FIRST_FRAME);
          }
  
          public void setResetBlocked(boolean resetBlocked) 
          {
              this.resetBlocked = resetBlocked;
          }
  
          @Override
          public void reset() 
          {
              if (! resetBlocked) super.reset();
          }
  
          @Override
          protected void applyTransformation(float interpolatedTime, Transformation t) 
          {
              final float alpha = mFromAlpha;
              t.setAlpha(alpha + ((mToAlpha - alpha) * interpolatedTime));
          }
  
          @Override
          public boolean willChangeTransformationMatrix() 
          {
              return false;
          }
  
          @Override
          public boolean willChangeBounds() 
          {
              return false;
          }
      } 
  </code></pre>
  
  <h2>Question:</h2>
  
  <p>btn_A, B and C are implemented with the same <code>setOnClickListener</code>. However, when they are pressed, nothing happen. Why? How can the above be modified?</p>
  
  <p>Thanks!</p>