title: Launching an option menu from ListView in Android
body: <p>First of all I'm new in Programming Android and in StackOverflow!!</p>
  
  <p>I've created a ListView dynamicaly, I mean, I load the list with lines from a file.</p>
  
  <p>Now, what I want to do is to launch a menu, like options menu,when an item has been clicked.</p>
  
  <p>I searched and the easy way is by using the inflate method however it uses a menu as argument.
  However I've set up a listener with OnItemClick which uses as argument an AdapterView, a View arg1, a int arg2, and a long arg3, but I a need a menu to the inflate method ... :S</p>
  
  <p>here's the code for mainactivity:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.menu);
  
     ListView list = (ListView) findViewById(R.id.listView1);
  
     func = getTurmas();
     list.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, func));
  
     list.setOnItemClickListener(new AdapterView.OnItemClickListener()  {  
  
              public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,
                      int arg2, long arg3) {
                  //System.out.println("teste");
                  MenuInflater inflater = getMenuInflater();
                  inflater.inflate(R.menu.menu_showup, null);
                 //my problem is here,instead of NULL I should put a menu, but how?
  
              }  
            });        
  }
  </code></pre>
  
  <p>Note: In menu folder I have my menu created with 3 items</p>
  
  <p>Thanks in advance for any help</p>
  
  <p>Best Regards,</p>
  
  <p>Karloz</p>