title: android: adding to options menu dynamically
body: <p>I am just trying to add other activities to my options menu
  I have my app which displays its menu defined as</p>
  
  <pre><code>public class OptionsMenuTesterActivity 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) {
              super.onCreateOptionsMenu(menu);
  
              // Create an Intent that describes the requirements to fulfill, to be included
              // in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE. 
              Intent intent = new Intent(null,getIntent().getData());
              intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
  
              // Search for, and populate the menu with, acceptable offering applications.
              menu.addIntentOptions(
                      Menu.CATEGORY_ALTERNATIVE,  // Menu group 
                   0,      // Unique item ID (none)
                   0,      // Order for the items (none)
                   this.getComponentName(),   // The current Activity name
                   null,   // Specific items to place first (none)
                   intent, // Intent created above that describes our requirements
                   0,      // Additional flags to control items (none)
                   null);  // Array of MenuItems that corrolate to specific items (none)
  
              return true;
          }
      }
  </code></pre>
  
  <p>now i have created another simple app with one activity and its androidmaifest looks as below</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.idg.test.dynamicoptionsmenu"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="10" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;activity
              android:name=".DynamicOptionsMenuTesterActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter label="test menu"&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
                   &lt;category android:name="android.intent.category.ALTERNATIVE" /&gt;
  
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>i have both applications launched. But when i click on the menu of first app, i dont see anything
  Can you help me telling what i am missing here.</p>