title: Android ListView creates the views but doesn't display them
body: <p>I am having problems with ListView on android. I have an Activity with an EditText view and a button. The idea is user should enter some info in the EditText field, touch the Search button which retrieves a list from a web service that it is displayed in the same activity below the EditText and the Button. Everything fine, I got the data from Internet but items weren't displaying. I was using the notifyDataSetChanged(). After a couple of hours with no success, I decided trying to put some items manually and it turns out that again nothing was displayed, hence I think I am doing something wrong when I am trying to set the listview and the adapter. So here is the code..</p>
  
  <p>the xml of the activity activity_search.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent" 
      android:layout_margin="5dp"&gt;
  
      &lt;EditText
          android:id="@+id/edit_search"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="5"
          android:inputType="text"
          android:hint="Enter info"
          android:ems="10" &gt;
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;Button 
          android:id="@+id/button_search"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:background="@android:drawable/ic_menu_search"
          android:contentDescription="Search"
          android:ems="10" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;ListView
      android:id="@+id/listview_items" 
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:drawSelectorOnTop="false" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>The XML of the item row.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" 
  android:orientation="vertical"
  android:layout_margin="5dp"&gt;
  
  &lt;TextView
      android:id="@+id/row_code"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/Common_TextContent" 
      android:textAppearance="@android:style/TextAppearance.Holo.Medium" /&gt;
  
  &lt;TextView
      android:id="@+id/row_name"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginLeft="10dp"
      android:text="@string/Common_TextContent"
      android:textAppearance="@android:style/TextAppearance.Holo.Small" /&gt;&lt;/LinearLayout&gt;
  </code></pre>
  
  <p>the custom Adapter:</p>
  
  <pre><code>public class ItemsListAdapter extends ArrayAdapter&lt;ItemsList&gt; {
  
  
  private int[] colors = new int[] { 0x30ffffff, 0x30808080 };
  
  public AssetListAdapter(Context context,
          List&lt;ItemsList&gt; itemsList) {
      super(context, 0, itemsList);
  
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      if (convertView == null) {
          convertView = LayoutInflater.from(getContext()).inflate(R.layout.row, null);
      }
  
      convertView.setBackgroundColor(colors[position % colors.length]);
  
      TextView code = (TextView) convertView.findViewById(R.id.row_code);
      code.setText(getItem(position).getCode());
  
      TextView name = (TextView) convertView.findViewById(R.id.row_name);
      name.setText(getItem(position).getName());
  
      return convertView;
  }
  </code></pre>
  
  <p>and the onCreate method on the Activity</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_search);
  
      _listView = (ListView) findViewById(R.id.listview_items);
      _listItems = new ArrayList&lt;ItemsList&gt;();
  
      _listItems.add(new ItemsList ("cosa1", "cosa1", "cosa1", "cosa1"));
      _listItems.add(new ItemsList ("cosa2", "cosa2", "cosa2", "cosa2"));
      _listItems.add(new ItemsList ("cosa3", "cosa3", "cosa3", "cosa3"));
  
      _adapter =  new ItemsListAdapter(this, _listItems);
      _listView.setAdapter(_adapter);
  
  }
  </code></pre>
  
  <p>The ItemsList is just an Object with 4 strings with all the getters implemented.
  When I debug in the getView method of the Adapter, the view (convertView) is created and it has the right information. It is just that is not showing those in the screen. What am I doing wrong? </p>
  
  <p>Thanks...</p>