title: Hide Android Context Menu Item
body: <p>Another newbie question.  I have a context menu that I apply for a ListView that simply allows the user to move items up or down, or delete the item.  </p>
  
  <p>I have code in onContextItemSelected() to prevent things from moving up past top or bottom of the list, etc., but I'd rather hide the context menu items in the first place if (for instance) the top item in the list is selected.</p>
  
  <p>I assume that I need to do this in onCreateContextMenu, but I'm not sure how.</p>
  
  <p>Here is my onCreateContextMenu code:</p>
  
  <pre><code>@Override
  public void onCreateContextMenu(ContextMenu menu, View v,
          ContextMenuInfo menuInfo) {
      super.onCreateContextMenu(menu, v, menuInfo);
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.mycontextmenu, menu);
  }
  </code></pre>
  
  <p>Thanks,<br/>
  wTs</p>