Code example for ContextMenu

Methods: add, getItem

0
	OnCreateContextMenuListener create_cmenu_voicerec(final long rowid, final Uri uri){
		OnCreateContextMenuListener cmenu_voicerec = new OnCreateContextMenuListener() {
			@Override 
			public void onCreateContextMenu(ContextMenu menu, View v,
					ContextMenuInfo menuInfo) {
				menu.add("elimina registrazione");
				menu.getItem(0).setOnMenuItemClickListener(new OnMenuItemClickListener() {
					@Override 
					public boolean onMenuItemClick(MenuItem arg0) {
						deleteVoicerec(rowid, uri);
						return true; 
					} 
				}); 
			} 
		}; 
		return cmenu_voicerec;
	} 
	 
	/** 
	 *  
	 * @param rowid