Code example for ContextMenu

Methods: add, getItem

0
	 */ 
	OnCreateContextMenuListener cmenu_text_edit = new OnCreateContextMenuListener() {
		@Override 
		public void onCreateContextMenu(ContextMenu menu, View v, 
				ContextMenuInfo menuInfo) { 
			menu.add("modifica testo"); 
			menu.getItem(0).setOnMenuItemClickListener(new OnMenuItemClickListener() { 
				@Override 
				public boolean onMenuItemClick(MenuItem item) { 
					callTextEditor(); 
					return true; 
				} 
			}); 
			menu.add("elimina testo"); 
			menu.getItem(1).setOnMenuItemClickListener(new OnMenuItemClickListener() { 
				@Override 
				public boolean onMenuItemClick(MenuItem item) { 
					deleteText(); 
					return true; 
				} 
			});