title: Animation drawable in ListView row
body: <p>I encountered following problem. I have a <code>ListView</code> where every row looks like this</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent" android:layout_height="match_parent"
  android:duplicateParentState="true" &gt;
  
  &lt;ImageView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginLeft="100dp"
      android:id="@+id/dashplayer"
      android:layout_centerHorizontal="true"
      android:focusable="false"
      android:clickable="false"
      android:tag="1"
      android:src="@android:color/transparent"
     android:layout_below="@+id/name"
      android:layout_marginTop="5dp"
      android:layout_marginBottom="10dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Camera name"
      android:id="@+id/name"
      android:textColor="@android:color/white"
      android:layout_marginTop="10dp"
      android:layout_centerHorizontal="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>So far so good, then I have an adapter with <code>getView</code> method like this:</p>
  
  <pre><code>@Override
  public View getView(final int position, View convertView, ViewGroup parent) {
      final String name = getItem(position);
      LayoutInflater li = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = li.inflate(R.layout.dash_row, parent, false);
      ImageView iv=(ImageView) convertView.findViewById(R.id.dashplayer);
  
      if(!cameras.get(position).isActive()){
          iv.setImageResource(R.drawable.noise);  // HERE COMES THE ANIMATION
      }else{
          iv.setImageBitmap(cameras.get(position).getCurrentFrame()); //static bitmap, works fine
      }
     return convertView;
  }
  </code></pre>
  
  <p>First it inflates the xml given above and after that puts into <code>ImageView</code> either an animation drawable or static bitmap. Bitmap works well, but the problem is with the animation.
  It is defined in xml like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"
  android:oneshot="false"&gt;
  &lt;item android:drawable="@drawable/frame0" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame1" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame2" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame3" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame4" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame5" android:duration="80" /&gt;
  &lt;item android:drawable="@drawable/frame6" android:duration="80" /&gt;
  &lt;/animation-list&gt;
  </code></pre>
  
  <p>What troubles me is that the animation stops after a while (possibly when I call <code>notifyDatasetChanged</code>, but I am not sure on this one). After I scroll the list it starts playing again. I can also make it play by calling <code>listView.scrollListBy(0);</code>(or something similar in older API), but still the animation is somewhat choppy.</p>
  
  <p>Does anyone have any idea, why the animation stops ?</p>