title: Android ListView items overlap while scrolling
body: <p>I have implemented a <code>ListView</code> in my application using a custom implementation of <code>CursorAdapter</code>. My problem is, that whenever I fling to scroll quickly to the bottom of the list (right after launching the application), I sometimes end up with all the ListView items drawn overlapping each other. If I scroll back up or touch one of the items, they become properly arranged.</p>
  
  <p>Here is how it looks after I quickly scroll down :
  <a href="http://i.stack.imgur.com/cTcfD.png" rel="nofollow">http://i.stack.imgur.com/cTcfD.png</a></p>
  
  <p>Here is how it looks when I am select-<em>ing</em> one of the items :
  <a href="http://i.stack.imgur.com/ZTRSt.png" rel="nofollow">http://i.stack.imgur.com/ZTRSt.png</a></p>
  
  <p>Here is the XML for my <code>ListView</code> :</p>
  
  <pre><code>&lt;ListView
          android:id="@+id/all_reminders_list"
          android:paddingLeft="4dp"
          android:paddingRight="4dp"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_weight="1"
          android:layout_alignParentLeft="true"
          android:clickable="true"
          android:dividerHeight="1.0sp"
          android:animateLayoutChanges="true"&gt;
  </code></pre>
  
  <p>Here's the <code>newView(..)</code> method of my custom CursorAdapter :</p>
  
  <pre><code>public View newView(Context context, Cursor cursor, ViewGroup parent) {
      LayoutInflater inflater = LayoutInflater.from(parent.getContext());
      View view = inflater.inflate(R.layout.view_list_item, parent, false);
      return view;
  }
  </code></pre>
  
  <p>And this is the <code>bindView(..)</code> method :</p>
  
  <pre><code>    public void bindView(View view, Context context, Cursor cursor) {
  
          TextView whatTextView = (TextView) view.findViewById(R.id.item_what_text);
          whatTextView.setText(cursor.getString(1));
          TextView whenTextView = (TextView) view.findViewById(R.id.item_when_text);
  
  
          if(cursor.getInt(9) != 0) // DONE_FLAG = 1 (completed)
          {
              //Arrow visibility
              ImageView arrow = (ImageView)view.findViewById(R.id.list_item_arrow);
              arrow.setVisibility(View.INVISIBLE);
  
              //Text color
              whatTextView.setTextColor(Color.LTGRAY);
              whenTextView.setTextColor(Color.LTGRAY);
  
              //WHEN text
              whenTextView.setText(TimeCalculationHelper.getCompletedTimeString(cursor.getLong(2)));
          }
          else // DONE_FLAG = 0
          {
              //Arrow visibility
              ImageView arrow = (ImageView)view.findViewById(R.id.list_item_arrow);
              arrow.setVisibility(View.VISIBLE);
  
              //Text color
              whatTextView.setTextColor(Color.BLACK);
              whenTextView.setTextColor(Color.BLACK);
  
              //WHEN text
              whenTextView.setText(TimeCalculationHelper.getTimeRemainingString(cursor.getLong(2)));
  
  
          }
  }
  </code></pre>
  
  <p>I've also noticed that I have been able to replicate it only when my device (Galaxy S2) is in power saving mode. Is there something I should be doing differently here? Thanks in advance!</p>
  
  <p><strong>EDIT</strong> : Including the list item's layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:paddingLeft="2dp"&gt;
  
  &lt;TextView android:id="@+id/item_what_text"
            android:lines="1"
            android:maxLines="2"
            android:textSize="22dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="3dp"/&gt;
  
  &lt;TextView android:id="@+id/item_when_text"
            android:lines="1"
            android:maxLines="1"
            android:textSize="14dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="13 minutes"
            android:paddingBottom="2dp"
            android:layout_below="@+id/item_what_text"/&gt;
  
  &lt;ImageView
      android:id="@+id/list_item_arrow"
      android:src="@drawable/next"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"/&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>