title: How to Create option menu in FragmentActivity?
body: <p>Hi Below is the code I am using to create option menu in my FragmentActivity :- </p>
  
  <pre><code>    @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          super.onCreateOptionsMenu(menu);
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      // Menu options to set and cancel the alarm.
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              // When the user clicks START ALARM, set the alarm.
              case R.id.start_action:
                  alarm.setAlarm(this);
                  return true;
              // When the user clicks CANCEL ALARM, cancel the alarm. 
              case R.id.cancel_action:
                  alarm.cancelAlarm(this);
                  return true;
          }
          return false;
      }
  </code></pre>
  
  <p>Will anybody tell me why it's not working? It is not affecting app but nothing is happening when I click the option menu button from device. Please Help to resolve this.
  Thanks in advance!</p>
  
  <p>Below is my main.xml :-</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:id="@+id/start_action"
          android:showAsAction="ifRoom|withText"
          android:title="@string/start_text" /&gt;
      &lt;item android:id="@+id/cancel_action"
          android:showAsAction="ifRoom|withText"
          android:title="@string/cancel_text" /&gt;
  &lt;/menu&gt;
  </code></pre>