create a drawable file
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/13507659/creating-a-drawable-file-to-make-a-separator">creating a drawable file to make a separator</a>  </p>
</blockquote>



<p>I am using the following code to create a divider between two fields:</p>

<pre><code>&lt;View
    android:layout_width="1dp"
    android:layout_height="wrap_content"
    android:background="#000000" /&gt;

&lt;View
    android:layout_width="1dp"
    android:layout_height="wrap_content"
    android:background="#FFFFFF" /&gt;
</code></pre>

<p>The code works perfectly but I want achieve something like this:</p>

<pre><code>&lt;View
    android:layout_width="2dp"
    android:layout_height="wrap_content"
    android:background="@drawable/divider" /&gt;
</code></pre>

<p>Doing so will help me combine 2 Views into one. However I don't know what code to write in the divider.xml file. I tried the following but it didn't work:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;item &gt;
    &lt;shape android:shape="rectangle" &gt;
       &lt;stroke android:color="#000000"/&gt;
       &lt;size android:width="1dp" /&gt;
    &lt;/shape&gt;
&lt;/item&gt;
&lt;item &gt;
    &lt;shape android:shape="rectangle" &gt;
       &lt;stroke android:color="#FFFFFF"/&gt;
       &lt;size android:width="1dp" /&gt;
    &lt;/shape&gt;
&lt;/item&gt;
</code></pre>

<p>
How do I correct this?</p>
