title: ListFragment - How do I add a menu?
body: <p>I have a ListFragment and I have to add a menu. This is my code:
  listuser_menu:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item
      android:id="@+id/any_option"
      android:title="In Context Menu" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>My ListFragment:</p>
  
  <pre><code>@Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
      View mFooterView;
      // We need to use a different list item layout for devices older than Honeycomb
      int layout = Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB ?
      android.R.layout.simple_list_item_activated_1:android.R.layout.simple_list_item_1;
      if(getListAdapter()==null){
          // init adapter
          adapter=new UserArrayAdapter(getActivity(),
                  MOBILE_OS);
      }
      else{
              adapter.notifyDataSetChanged(); 
          } 
  
      // set adapter
      registerForContextMenu(getListView());
      setListAdapter(adapter);
  
  }
  @Override
  public void onCreateContextMenu(final ContextMenu menu, final View v,
  final ContextMenuInfo menuInfo){
      menu.clear();
      super.onCreateContextMenu(menu, v, menuInfo);   
      final MenuInflater inflater = getActivity().getMenuInflater();
      inflater.inflate(R.menu.listuser_menu, menu);   
  }
  </code></pre>
  
  <p>But i can't see my menu..why? How register option menu selected? Thanks!</p>