Code example for MenuItem

Methods: getGroupId, getItemId

0
            menu.add(2, 4, 0, R.string.info_platoon_member_new_deny);
        } 
    } 
 
    public boolean handleSelectedContextItem(AdapterView.AdapterContextMenuInfo info, MenuItem item) {
        if (item.getGroupId() == 2) {
            ProfileData user = (ProfileData) info.targetView.getTag();
            switch(item.getItemId()) {
            	case 0: 
                    startActivity(new Intent(mContext, ProfileActivity.class).putExtra("profile", user));
            		break; 
            	case 1: 
            		modifyMembership(user);
            		break; 
            	case 2: 
            		kickUser(user);
            		break; 
            	case 3: 
            		answerUserApplication(user, true);
            		break; 
            	case 4: