code: @Override
      public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
          if (parent == mFreqSpinner) {
              mModel.freq = position;
          } else if (parent == mEndSpinner) {
              switch (position) {
                  case RecurrenceModel.END_NEVER:
                      mModel.end = RecurrenceModel.END_NEVER;
                      break;
                  case RecurrenceModel.END_BY_DATE:
                      mModel.end = RecurrenceModel.END_BY_DATE;
                      break;
                  case RecurrenceModel.END_BY_COUNT:
                      mModel.end = RecurrenceModel.END_BY_COUNT;
  
                      if (mModel.endCount <= 1) {
                          mModel.endCount = 1;
                      } else if (mModel.endCount > COUNT_MAX) {
                          mModel.endCount = COUNT_MAX;
                      }
                      updateEndCountText();
                      break;
              }
              mEndCount.setVisibility(mModel.end == RecurrenceModel.END_BY_COUNT ? View.VISIBLE
                      : View.GONE);
              mEndDateTextView.setVisibility(mModel.end == RecurrenceModel.END_BY_DATE ? View.VISIBLE
                      : View.GONE);
              mPostEndCount.setVisibility(
                      mModel.end == RecurrenceModel.END_BY_COUNT && !mHidePostEndCount ?
                              View.VISIBLE : View.GONE);
  
          }
          updateDialog();
      }
docs: End spinner