title: What is causing this animation flicker and how do I remove it?
body: <p>I have made a tiny android application to attempt to resolve an issue I've been seeing on a different app. I'm trying to achieve an effect where the <code>TextView</code>starts off screen, then scrolls on. </p>
  
  <p>What I did looks like it's working well on my 4.0.4, but when I use the Android Virtual Device (4.1.2) there is a "flicker" showing the <code>TextView</code> in the original place before the animation starts. I've noticed the same thing on a friend's Tablet (4.4).</p>
  
  <p>I uploaded a video to show the issue <a href="http://youtu.be/06Dkc4TtkAY" rel="nofollow">here</a>.</p>
  
  <p>My layout:</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;TextView
          android:id="@+id/txtV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello_world" /&gt;
  </code></pre>
  
  <p>During my MainActivity's <code>onResume()</code> function I move the <code>TextView</code> off screen for a starting position:</p>
  
  <pre><code>@Override
  protected void onResume(){
  super.onResume();
  View v = findViewById(R.id.txtV);
  Animation hideWords = AnimationUtils.loadAnimation(getBaseContext(), R.anim.hidetext);
  hideWords.setAnimationListener(new AnimationListener() {
      @Override
      public void onAnimationEnd(Animation animation) {
          View v = findViewById(R.id.txtV);
          int xOffset = (int)(v.getWidth() * .1);
          RelativeLayout.LayoutParams rlParams = 
              (RelativeLayout.LayoutParams)v.getLayoutParams();
          rlParams.setMargins(-1*xOffset, 0, xOffset, 0);
          v.setLayoutParams(rlParams);
      }
  </code></pre>
  
  <p>And then there's a Button which just has onClick set to the function <code>animateIt()</code> the source of which is:</p>
  
  <pre><code>public void animateIt(View v){
      v = findViewById(R.id.txtV);
      AnimationSet as = new AnimationSet(true);
      Animation showWords = AnimationUtils.loadAnimation(
          getBaseContext(), R.anim.texnation);
      as.addAnimation(showWords);
      v.startAnimation(as);
  }
  </code></pre>
  
  <p>The animation just slides the <code>View</code> onscreen:</p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android"    
      android:shareInterpolator="false"    
      android:duration="700"    
      android:fillAfter="true"    
      android:interpolator="@android:anim/linear_interpolator" &gt;
      &lt;translate
          android:fromXDelta="-100%"    
          android:toXDelta="0%"    /&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>So what I'm trying to figure out is what I've done incorrectly here that's causing that flicker. Right after the button is pushed for the first time the text flickers on the screen then it disappears and slides on as expected. </p>
  
  <p>Any ideas?</p>