Code example for MenuItem

Methods: getItemId, getMenuInfo

0
    } 
 
    @Override 
    public boolean onContextItemSelected(MenuItem item) {
        final AdapterView.AdapterContextMenuInfo menuInfo = (AdapterView.AdapterContextMenuInfo)
                item.getMenuInfo();
        final NamedGesture gesture = (NamedGesture) menuInfo.targetView.getTag();
 
        switch (item.getItemId()) {
            case MENU_ID_RENAME:
                renameGesture(gesture);
                return true; 
            case MENU_ID_REMOVE:
                deleteGesture(gesture);
                return true; 
        } 
 
        return super.onContextItemSelected(item);
    } 
 
    private void renameGesture(NamedGesture gesture) {