title: android listview alternate row color BUT with default cursor selection
body: <p>i have been all over the web, stackoverflow included and just can't seem to get a clear complete way to </p>
  
  <p>I want to create a ListView that</p>
  
  <p>1) has alternating colors (I am able to do that with code below)
  2) retains the default orange selection behavior of android</p>
  
  <p>to accomplish #1 I have an custom adapter that 
  extends ArrayAdapter and then  I override getView like so</p>
  
  <pre><code>public View getView(int position,  View convertView,   ViewGroup parent)
  {
    ....
  
    // tableLayoutId is id pointing to each view/row in my list
    View tableLayoutView = view.findViewById(R.id.tableLayoutId); 
    if(tableLayoutView != null)
    {
        int colorPos = position % colors.length;
        tableLayoutView.setBackgroundColor(colors[colorPos]);
    }
  }
  </code></pre>
  
  <p>my member variable for colors is</p>
  
  <pre><code>private int[] colors = new int[] { 0x30ffffff, 0x30ff2020, 0x30808080 };
  </code></pre>
  
  <p>followed the article "Android – Applying Alternate Row Color in ListView with SimpleAdapter" found <a href="http://ykyuen.wordpress.com/2010/03/15/android-%E2%80%93-applying-alternate-row-color-in-listview-with-simpleadapter/" rel="nofollow">here</a></p>
  
  <p>now this is where i am stuck, I see on stackoverflow some mention of doing this as it would see common, and they suggest adding this attribute to the </p>
  
  <p>android:listSelector="@color/list_item"</p>
  
  <p>where list_item.xml would be something like</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;item android:state_selected="true"
      android:drawable="@drawable/transparent" /&gt;
     .....
   &lt;/selector&gt;
  </code></pre>
  
  <p>Then I would have to add code to getView() to figure out which state I am in
  and act accordingly.</p>
  
  <p>Is there an example out there for getting this to work? Thanks all
  I'll gladly post mine for all to use if i could get it to work. :-(</p>