Android animation flickers
<p>I have an ImageView that I am animating using a TranslateAnimation. At the end of the animation I want to switch the drawable it is showing. It works but it flickers right before showing the image. I was originally using an AnimationListener and then I followed the examples I found of how to fix this by creating a custom view that extends ImageView and overrides OnAnimationEnd to no avail.</p>

<p>In my activity:</p>

<pre><code>TranslateAnimation = new TranslateAnimation(0, 150, 0, 150);
translateAnimation.setDuration(ANIMATION_DURATION);

    btn.setNextImage(buttons.get(2));
    btn.startAnimation(3000);
</code></pre>

<p>In my custom view I have the following:</p>

<pre><code>protected void onAnimationEnd() {   
   super.onAnimationEnd();

   //this.clearAnimation();

   if(_nextImage != null)
      this.setImageDrawable(_nextImage);
}

private Drawable _nextImage;

public void setNextImage(Drawable d)
{
    _nextImage = d;
}
</code></pre>
