code: public void setSelectionMode(final @SelectionMode int mode) {
      final @SelectionMode int oldMode = this.selectionMode;
      this.selectionMode = mode;
      switch (mode) {
        case SELECTION_MODE_RANGE:
          clearSelection();
          break;
        case SELECTION_MODE_MULTIPLE:
          break;
        case SELECTION_MODE_SINGLE:
          if (oldMode == SELECTION_MODE_MULTIPLE || oldMode == SELECTION_MODE_RANGE) {
            //We should only have one selection now, so we should pick one
            List<CalendarDay> dates = getSelectedDates();
            if (!dates.isEmpty()) {
              setSelectedDate(getSelectedDate());
            }
          }
          break;
        default:
        case SELECTION_MODE_NONE:
          this.selectionMode = SELECTION_MODE_NONE;
          if (oldMode != SELECTION_MODE_NONE) {
            //No selection! Clear out!
            clearSelection();
          }
          break;
      }
  
      adapter.setSelectionEnabled(selectionMode != SELECTION_MODE_NONE);
    }
docs: Change the selection mode of the calendar. The default mode is {@linkplain
  #SELECTION_MODE_SINGLE}
  
  @param mode the selection mode to change to. This must be one of
  {@linkplain #SELECTION_MODE_NONE}, {@linkplain #SELECTION_MODE_SINGLE},
  {@linkplain #SELECTION_MODE_RANGE} or {@linkplain #SELECTION_MODE_MULTIPLE}.
  Unknown values will act as {@linkplain #SELECTION_MODE_SINGLE}
  @see #getSelectionMode()
  @see #SELECTION_MODE_NONE
  @see #SELECTION_MODE_SINGLE
  @see #SELECTION_MODE_MULTIPLE
  @see #SELECTION_MODE_RANGE