Code example for ActionMode

Methods: finish

0
	@Override 
	public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
		switch (item.getItemId()) {
		case MENUITEM_DELETE:
			delete(selectedItem);
			mode.finish();
			break; 
		default: 
			return super.onContextItemSelected(item);
		} 
 
		return true; 
	} 
 
	@Override 
	public boolean onCreateActionMode(ActionMode mode, Menu menu) {
		JSONObject person = adapter.getItem(selectedItem);
		mode.setTitle(person.optString("name"));
 
		MenuItem delete = menu.add(ContextMenu.NONE, MENUITEM_DELETE,
				ContextMenu.NONE, "Delete");