title: Custom listactivity divider
body: <p>I have a <code>ListActivity</code> that consists of many rows and I'm trying to customize the divider in between rows, so I can give the divider: a corners radius, change its color and apply a border, and so on.</p>
  <p>I tried to refer it to a drawable shape layout but it doesn't work; it force closes.</p>
  <p><code>listactivity</code> code :</p>
  <pre><code>public class Rows extends ListActivity {
        String classes[] = { &quot;row1&quot;, &quot;row2&quot;, &quot;row3&quot;,  &quot;row4&quot;, &quot;row5&quot;};                    
    @Override
        protected void onCreate(Bundle savedInstanceState) {
          this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
         // TODO Auto-generated method stub
           super.onCreate(savedInstanceState);
  
    ListView lv = getListView();   
    lv.setCacheColorHint(0);  
    lv.setSelector(android.R.color.transparent); 
    lv.setDivider(new ColorDrawable(this.getResources().getColor(R.drawable.divider)));  
    lv.setPadding(20, 0, 20, 0);
    lv.setVerticalScrollBarEnabled(false);
    lv.setBackgroundResource(R.drawable.list_background);
  
  setListAdapter(new MyArrayAdapter(this, classes));  
  }
  </code></pre>
  <p>divider.xml code :</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt; 
     &lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
         android:shape=&quot;rectangle&quot;&gt;
      &lt;stroke android:width=&quot;5dp&quot; android:height=&quot;5dp&quot; android:color=&quot;#B22222&quot; /&gt; 
      &lt;solid android:color=&quot;#FFFFFF&quot; /&gt; 
      &lt;padding android:left=&quot;10dp&quot;  android:right=&quot;10dp&quot;  /&gt; 
      &lt;corners android:radius=&quot;10dp&quot; android:bottomRightRadius=&quot;5dp&quot;
         android:bottomLeftRadius=&quot;5dp&quot; android:topLeftRadius=&quot;10dp&quot;
           android:topRightRadius=&quot;10dp&quot; /&gt; 
     &lt;/shape&gt;
  </code></pre>
  <p>What am I doing wrong?</p>