title: How to repeat an AnimationSet with sequentially added animations
body: <p>I am trying to make an animation in my <code>Activity</code>, to be repeated infinite times. I have already tried it in XML file with <code>repeatCount</code> and <code>repeatMode</code> attributes, but it doesn't work. The thing is that <code>myanimation.xml</code> file is constructed of a set of different animations.</p>
  
  <p>My XML file for that animation</p>
  
  <pre><code>&lt;set
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:fillAfter="true"
  android:interpolator="@android:anim/bounce_interpolator"
  &gt;
  
  
  
  &lt;translate
  
  
      android:startOffset="1000"
      android:fillAfter="true"
      android:fromXDelta="10"
      android:fromYDelta="10"
      android:toXDelta="50"
      android:toYDelta="-200"
      android:duration="1800"
      android:interpolator="@android:anim/bounce_interpolator"
  
      /&gt;
  
  
  
  &lt;translate
  
      android:fillAfter="true"
      android:startOffset="2000"
      android:fromYDelta="10"
      android:fromXDelta="10"
      android:toXDelta="100"
      android:toYDelta="270"
      android:duration="1800"
      android:interpolator="@android:anim/bounce_interpolator" /&gt;
  
  &lt;translate
  
      android:fillAfter="true"
      android:startOffset="3000"
      android:fromYDelta="10"
      android:fromXDelta="10"
      android:toXDelta="130"
      android:toYDelta="-270"
      android:duration="1800"
      android:interpolator="@android:anim/bounce_interpolator"
      /&gt;
  
  &lt;translate
  
      android:fillAfter="true"
      android:startOffset="4000"
      android:fromYDelta="10"
      android:fromXDelta="10"
      android:toXDelta="140"
      android:toYDelta="270"
      android:duration="1800"
      android:interpolator="@android:anim/bounce_interpolator"
      /&gt;
  
  &lt;translate
  
      android:fillAfter="true"
      android:startOffset="5000"
      android:fromYDelta="10"
      android:fromXDelta="10"
      android:toXDelta="90"
      android:toYDelta="-270"
      android:duration="1800"
      android:interpolator="@android:anim/bounce_interpolator"
      /&gt;
  </code></pre>
  
  <p></p>
  
  <p>And in <code>onCreate()</code> I have animation tied to a <code>ImageView</code> object.</p>
  
  <pre><code>    ImageView ball = (ImageView) findViewById(R.id.animationBall);
      final Animation myAnimation = AnimationUtils.loadAnimation(this,   R.anim.ball_animation);
      ball.startAnimation(myAnimation);
  </code></pre>
  
  <p>The animation works fine, the only thing is that it doesn't want to repeat itself, even if I set the <code>setRepeatMode()</code> or <code>setRepeatCount()</code> methods.</p>