Android: ContextMenu and ItemSelected in Context Menu
<p>This is the onCreate and oncontextitemslected 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.context_menu, menu);
    }

    @Override
    public boolean onContextItemSelected(MenuItem item) {
    Toast toast;
        if(item.getItemId() == R.id.context_menu_edit)
        {
            Log.d("ContextCheck","EDIT!");
            toast = Toast.makeText(this, "Edit!", Toast.LENGTH_SHORT);
            toast.show();
        }

        if(item.getItemId() == R.id.context_menu_delete)
        {
            Log.d("ContextCheck","DELETE!");
            toast = Toast.makeText(this, "Delete!", Toast.LENGTH_SHORT);
            toast.show();
        }

        return super.onContextItemSelected(item);
    }
</code></pre>

<p>and before that is i used the method <code>registerForContextMenu(event_list)</code> where  <code>event_list</code> is a ListView , no i don't know why when ever i click an item from the context menu, it doesn't do anything, it won't show the toast and won't log into the logcat... is the item.getItemId() same for OptionsMenu and ContextManu?.. i don't know what is wrong with my code..</p>

<p>PS
the context menu is called inside a dialog box in a listview</p>
