title: Context menu does not show in long click even of listview
body: <p>I have a listview. I want to show a context menu when I press long click in a item. And the context menu will be show "Delete" and "Edit". I implemented it by below code. However, It does not show up context menu when I press long click item. Note that, long click item is implemented successfully, however, it does not show context menu. Could you fix it help me? </p>
  
  <pre><code>public class ManageActivity extends Activity {
    private ListView mainListView ;
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.list_main);    
      // Find the ListView resource. 
      mainListView = (ListView) findViewById( R.id.mainListView );
      mainListView.setAdapter( listAdapter );     
      registerForContextMenu(mainListView);
   }
   mainListView.setOnItemLongClickListener(new android.widget.AdapterView.OnItemLongClickListener() {
  
          public boolean onItemLongClick(AdapterView&lt;?&gt; arg0, View arg1,
                  int pos, long id) {
              // TODO Auto-generated method stub
              String  audio_file_name    = (String) mainListView.getItemAtPosition(pos);
              Log.v("long clicked",String.valueOf(audio_file_name));
              return true;
          }
      });
  
    }
    @Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){
        menu.add(0, v.getId(), 0, "Edit");
        menu.add(0, v.getId(), 0, "Delete");
    }
    @Override
    public boolean onContextItemSelected(MenuItem item){
        if(item.getTitle()=="Edit")Toast.makeText(getApplicationContext(), "Edit Clicked", Toast.LENGTH_LONG).show();
        if(item.getTitle()=="Delete")Toast.makeText(getApplicationContext(), "Delete Clicked", Toast.LENGTH_LONG).show();
        return true;
    }
  </code></pre>
  
  <p>Update log</p>
  
  <pre><code>09-30 15:24:35.611: E/AndroidRuntime(26204): FATAL EXCEPTION: main
  09-30 15:24:35.611: E/AndroidRuntime(26204): java.lang.NullPointerException
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.example.test.ManageActivity.onContextItemSelected(ManageActivity.java:91)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.app.Activity.onMenuItemSelected(Activity.java:2728)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.policy.impl.PhoneWindow$DialogMenuCallback.onMenuItemSelected(PhoneWindow.java:4342)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:204)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:994)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.widget.AdapterView.performItemClick(AdapterView.java:308)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.widget.AbsListView.performItemClick(AbsListView.java:1509)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3471)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.widget.AbsListView$3.run(AbsListView.java:4834)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.os.Handler.handleCallback(Handler.java:733)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.os.Handler.dispatchMessage(Handler.java:95)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.os.Looper.loop(Looper.java:146)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at android.app.ActivityThread.main(ActivityThread.java:5602)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at java.lang.reflect.Method.invokeNative(Native Method)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at java.lang.reflect.Method.invoke(Method.java:515)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
  09-30 15:24:35.611: E/AndroidRuntime(26204):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>