title: custom listview adapter getView method being called multiple times, and in no coherent order
body: <p>I have a custom list adapter:</p>
  
  <pre><code>class ResultsListAdapter extends ArrayAdapter&lt;RecordItem&gt; {
  </code></pre>
  
  <p>in the overridden 'getView' method I do a print to check what position is and whether it is a convertView or not:</p>
  
  <pre><code>    @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          System.out.println("getView " + position + " " + convertView);
  </code></pre>
  
  <p>The output of this (when the list is first displayed, no user input as yet)</p>
  
  <pre><code>04-11 16:24:05.860: INFO/System.out(681): getView 0 null  
  04-11 16:24:29.020: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43d415d8  
  04-11 16:25:48.070: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43d415d8  
  04-11 16:25:49.110: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43d415d8  
  04-11 16:25:49.710: INFO/System.out(681): getView 0 android.widget.RelativeLayout@43d415d8  
  04-11 16:25:50.251: INFO/System.out(681): getView 1 null  
  04-11 16:26:01.300: INFO/System.out(681): getView 2 null  
  04-11 16:26:02.020: INFO/System.out(681): getView 3 null  
  04-11 16:28:28.091: INFO/System.out(681): getView 0 null  
  04-11 16:37:46.180: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43cff8f0  
  04-11 16:37:47.091: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43cff8f0  
  04-11 16:37:47.730: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43cff8f0  
  </code></pre>
  
  <p>AFAIK, though I couldn't find it stated explicitly, getView() is only called for visible rows. Since my app starts with four visible rows at least the position numbers cycling from 0-3 makes sense. But the rest is a mess:</p>
  
  <ul>
  <li>Why is getview called for each row three times? </li>
  <li>Where are these convertViews coming from when I haven't scrolled yet?</li>
  </ul>
  
  <p>I did a bit of reseach, and without getting a good answer, I did notice that people were associating this issue with layout issues. So in case, here's the layout that contains the list:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_height="fill_parent"
      android:layout_width="fill_parent" 
      android:orientation="vertical" &gt;
  
      &lt;TextView android:id="@+id/pageDetails"
          android:layout_width="fill_parent" 
          android:layout_height="wrap_content" /&gt;
  
      &lt;ListView android:id="@+id/list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" 
          android:drawSelectorOnTop="false" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and the layout of each individual row:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="108dp"    
  android:padding="4dp"&gt;
  
  &lt;ImageView
      android:id="@+id/thumb"        
      android:layout_width="120dp"
      android:layout_height="fill_parent"        
      android:layout_alignParentTop="true"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_marginRight="8dp"        
      android:src="@drawable/loading" /&gt;
  
  &lt;TextView  
      android:id="@+id/price"
      android:layout_width="wrap_content"
      android:layout_height="18dp"         
      android:layout_toRightOf="@id/thumb"
      android:layout_alignParentBottom="true"       
      android:singleLine="true" /&gt;
  
  &lt;TextView  
      android:id="@+id/date"
      android:layout_width="wrap_content"
      android:layout_height="18dp"         
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true" 
      android:paddingRight="4dp"       
      android:singleLine="true" /&gt;
  
  &lt;TextView
      android:id="@+id/title"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:textSize="17dp" 
      android:layout_toRightOf="@id/thumb"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:paddingRight="4dp"   
      android:layout_alignWithParentIfMissing="true"
      android:gravity="center" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Thank you for your time</p>