title: findviewbyid() returns null in custom Adapter in Eclipse
body: <p>Welcome to another <code>findviewbyid() returns null</code> question!</p>
  
  <p>I wrote an adapter class for displaying an array into a ListView. And gues what findviewbyid() returns null. (I checked all the other questions on this topic but they're not related to my problem).</p>
  
  <p>So here is my Adapter Class:</p>
  
  <pre><code>package de.kosmowski.discogs.wants;
  
  import java.util.ArrayList;
  
  import android.content.Context;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  import de.kosmowski.discogs.model.Want;
  
  public class WantAdapter extends ArrayAdapter&lt;Want&gt; {
  
  private ArrayList&lt;Want&gt; items;
  
  public WantAdapter(Context context, int textViewResourceId, ArrayList&lt;Want&gt; items) {
          super(context, textViewResourceId, items);
          this.items = items;
  }
  
  
  public View getView(int position, View convertView, ViewGroup parent) {
          View v = convertView;    
  
          Want w = items.get(position);
          Log.d("WantAdapter", "want:" + w);
  
          if (v == null) {
               LayoutInflater vi = (LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
               if(w != null &amp;&amp; w.getType()!= null &amp;&amp; (w.getType().equals(Want.TYPE_RELEASE) || w.getType().equals(Want.TYPE_MASTER)))
               {
                   Log.d(this.getClass().getCanonicalName(), "Choosing Release List Item");
                   v = vi.inflate(R.layout.releaselistitem, null);
               }
               else
               {
                   v = vi.inflate(R.layout.lplistitem, null);
               }
  
          }
  
          if (w != null) {
  
                  ImageView icon = (ImageView) v.findViewById(R.id.typeicon); //Returns NULL at this line
  
                  TextView tt = (TextView) v.findViewById(R.id.text1);
  
                  if(w.getType() != null)
                  {
                      if(w.getType().equals(Want.TYPE_ARTIST))
                      {
                          icon.setImageResource(R.drawable.resulttype_artist);
                      }
                      else if(w.getType().equals(Want.TYPE_RELEASE))
                      {
                          icon.setImageResource(R.drawable.resulttype_lp);
                      }
                      else if(w.getType().equals(Want.TYPE_MASTER))
                      {
                          icon.setImageResource(R.drawable.resulttype_lp_master);
                      }
                      else
                      {
                          icon.setImageResource(R.drawable.defaultresult);
                      }
                  }
                  else
                  {
                      icon.setImageResource(R.drawable.defaultresult);
                  }
  
  
  
                  if (tt != null) {
                        tt.setText(w.getName());                            }                    
          }
          return v;
  }
  
  
  }
  </code></pre>
  
  <p>I marked the line where null is returned.</p>
  
  <p>And here is the inflated xml file (both the lplistitem and the releaselistitem are currently exactly the same):</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_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"&gt;
  
    &lt;ImageView android:scaleType="center" android:layout_gravity="center_vertical" android:src="@drawable/defaultresult" android:id="@+id/typeicon" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageView&gt;
  
    &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/text1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:gravity="center_vertical"
      android:paddingLeft="6dip"
      android:textSize="16px"
      android:minHeight="?android:attr/listPreferredItemHeight"
  /&gt; 
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Can you see any obvious errors? Everything seems right to me.</p>