title: android listview multiple views
body: <p>I have a listview with 2 views, one is for the first row and the other is for the rest.</p>
  
  <p>Here is my code in getView:</p>
  
  <pre><code>ViewHolder holder = null;
  
              // if (convertView == null) 
          //   {  
                   holder = new ViewHolder();
  
                   if(position==0 &amp;&amp; category.equalsIgnoreCase("normal"))
                   {
                       convertView = mInflater.inflate(R.layout.item_featured_list_row, null);                                         
                   } 
                   else
                   {                   
                       convertView = mInflater.inflate(R.layout.item_list_row, null);         
                   }      
  
                       holder.imgItem = (ImageView) convertView.findViewById(R.id.itemImage);
                       //holder.imgArrow = (ImageView) convertView.findViewById(R.id.arrowImage);
                       holder.txtItem = (TextView) convertView.findViewById(R.id.itemText);
                       holder.itemValueLabel = (TextView) convertView.findViewById(R.id.itemValueLabel);
                       holder.itemPrice = (TextView) convertView.findViewById(R.id.itemPrice);                            
  
                   convertView.setTag(holder);
          //   } 
          //   else 
          //       holder = (ViewHolder) convertView.getTag();
  </code></pre>
  
  <p>The thing is, it will only work this way if I leave it uncommented, but I feel like there is a good reason to check if convertView is null and not re-inflate something already inflated.  But if I uncomment it, it only works on the first load.  Once I refresh the list by updating the array and calling notifydatasetchanged, the first row items ends up multiple times in random locations in my listview.</p>