android list view - row color
<p>I am trying to develop a simple android app. It has two text boxes for entering search criteria. A submit button to submit the page. In the next page (new intent) I show search results.</p>

<p>Now I want to search results in a listview. The xml code of the view looks like below.</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="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"&gt;

 &lt;ImageView
    android:id="@+id/image"
    android:layout_width="50px"
    android:layout_height="50px"
    android:layout_marginLeft="5px"
    android:layout_marginRight="20px"
    android:layout_marginTop="5px"&gt;
&lt;/ImageView&gt;

&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp" 
android:orientation="vertical"&gt;

&lt;TextView
    android:id="@+id/label"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@+id/label"
    android:textSize="15px" &gt;
&lt;/TextView&gt;
&lt;TextView
    android:id="@+id/addr"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@+id/label"
    android:textSize="15px" &gt;
&lt;/TextView&gt;
</code></pre>

<p>
</p>

<p>In the XXXArrayAdapter class, getView method, I set background color as below.</p>

<pre><code>  private int[] colors = new int[] { 0x30FF0000, 0x300000FF };
 int colorPos = position % colors.length;
 rowView.setBackgroundColor(colors[colorPos]);
</code></pre>

<p>However, I do not see backgorund color filling the entire row. Please see below screenshot. Ignore red boxes, I am intentionally hiding the search results.</p>
