title: How to add border to listview and different row colors at the same time
body: <p>I'm trying to have a border on the outside of my listview and a different color for every other row at the same time </p>
  
  <p><img src="https://i.stack.imgur.com/AyeA0.png" alt="enter image description here"></p>
  
  <p>here's the getView method from my adapter</p>
  
  <pre><code>        viewHolder.dateView.setText(entry.getDateString("yyyy-MM-dd HH:mm"));
          if(position % 2 == 0){
              viewHolder.linearLayout.setBackgroundResource(R.color.grey);
  
          }
          else{
              //viewHolder.linearLayout.setBackgroundResource(R.color.white);
          }
  </code></pre>
  
  <p>here's the xml file which I use to make the border on the <strong>listview</strong> not the cell</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" &gt;
     &lt;!-- use this for transparent --&gt;
     &lt;!-- &lt;solid android:color="#00000000" /&gt; --&gt;
     &lt;!-- use this for a background colour --&gt;
     &lt;solid android:color="@color/white" /&gt;
     &lt;stroke android:width="2dip" android:color="@color/black"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>if I set the backround to the cell it I can no longer see the border</p>