Code example for ContextMenu

Methods: add, setHeaderTitle

0
		Cursor tPatientCursor = (Cursor) o;
		// we can also set ids to the menu for easier discrimination in the 
		// handler. For 
		// now i use the title and check if == cancel 
		menu
				.setHeaderTitle("Patient: "
						+ tPatientCursor.getString(NAME_COLUMN));
 
		menu.add(0, MENU_FILL_FORM, 0, "Fill out form");
		menu.add(0, MENU_INFO, 0, "Patient info");
		menu.add(0, MENU_CANCEL, 0, "Cancel");
	} 
 
	@Override 
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Object o = this.getListAdapter().getItem(position);
		mPatientCursor = (Cursor) o;
 
		l.showContextMenuForChild(v);
 
		super.onListItemClick(l, v, position, id);