remove line between custom option menu items
<p>I customized the option menu, removed default background and customized the item it self by referring to a style, but I stack in removal the line between the items as shown in pic.</p>

<p>Any advice will be appreciated.</p>

<p><img src="http://i.stack.imgur.com/MmJOh.jpg" alt="enter image description here"></p>

<p>My code :</p>



<pre><code>   &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="rectangle"&gt;
      &lt;stroke android:width="1dp" android:height="1dp" android:color="#B22222" /&gt; 
   &lt;solid android:color="#FCE6C9" /&gt; 
     &lt;padding android:left="2dp" android:top="2dp" android:right="2dp"
          android:bottom="2dp" /&gt; 
   &lt;corners  android:bottomRightRadius="30dp"  android:bottomLeftRadius="30dp"
     android:topLeftRadius="30dp"  android:topRightRadius="30dp" /&gt;

    &lt;/shape&gt;  
</code></pre>

<hr>

<p>Option menu code :</p>

<pre><code>  public class OptionMenu extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);}

public boolean onCreateOptionsMenu(android.view.Menu menu) {

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.cool_menu, menu);

    getLayoutInflater().setFactory(new Factory() {
    public View onCreateView(String name, Context context,
    AttributeSet attrs) {

    if (name .equalsIgnoreCase("com.android.internal.view.menu.IconMenuItemView")) {
    try {

    LayoutInflater li = LayoutInflater.from(context);
    final View view = li.createView(name, null, attrs);

    new Handler().post(new Runnable() {
    public void run() {

    // set the background drawable
    view .setBackgroundResource(R.drawable.border);

    ((TextView) view).setTextSize(20); 

    // set the text color
    ((TextView) view).setTextColor(Color.RED);}
        });
    return view;}
     catch (InflateException e) { }
     catch (ClassNotFoundException e) { }
            }
    return null; }
            });
    return super.onCreateOptionsMenu(menu);}


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // TODO Auto-generated method stub
        switch (item.getItemId()) {
        case R.id.AboutUs:
            Intent i = new Intent("com.test.demo.ABOUT");
            startActivity(i);

             break;
                 case R.id.preferences:
                 Intent p = new Intent("com.test.demo.PREFS");
                 startActivity(p);
             break;
             case R.id.exit:
                   finish();
             break;}
            return false;} }
</code></pre>

<hr>

<p>cool_menu.xml :</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
 &lt;item android:title="about"  android:id="@+id/AboutUs"  /&gt; 
 &lt;item android:title="Prefs"  android:id="@+id/preferences" /&gt; 
 &lt;item android:title="Exit"   android:id="@+id/exit" /&gt; 
 &lt;/menu&gt;
</code></pre>

<hr>

<p>menu_style.xml :</p>

<pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
     &lt;resources&gt;
        &lt;style name="Theme_menu"&gt;
        &lt;item name="android:panelFullBackground"&gt;@drawable/border&lt;/item&gt; 
          &lt;/style&gt;
     &lt;/resources&gt;
</code></pre>

<hr>

<p>referal of style in manifest to option menu :</p>

<pre><code>  &lt;activity
           android:name=".OptionMenu"
           android:label="@string/app_name" android:theme="@style/Theme_menu"&gt;
</code></pre>
