title: How to add Menu in android
body: <p>I want to know about menu.I tried using some codes given in net.It seems simple but can't get output when i run application.I used onCreateOptionMenu and menuinflater.I created a new folder under res and named it as menu and i add item in menu.xml under it.But can't get output.kindly let me know my mistake.</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:id="@+id/icon"
      android:title="ICON"/&gt;
  &lt;item android:id="@+id/text"
      android:title="Text" /&gt;
  &lt;item android:id="@+id/icontext"
      android:title="Icon and text"
      /&gt;
  &lt;/menu&gt; 
  </code></pre>
  
  <p>Activity:</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuInflater;
  
  public class Simple extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu)
      {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.menu, menu);
          return true;                  
      }
  }
  </code></pre>