code: private OnItemSelectedListener createItemSelectedListener() {
          return new OnItemSelectedListener() {
  
              @Override
              public void onItemSelected(final AdapterView<?> parent, final View view,
                                         final int position, final long id) {
                  if (getOnItemSelectedListener() != null) {
                      getOnItemSelectedListener().onItemSelected(parent, view, position, id);
                  }
  
                  if (isValidatedOnValueChange() && position != 0) {
                      validate();
                  }
              }
  
              @Override
              public void onNothingSelected(final AdapterView<?> parent) {
                  if (getOnItemSelectedListener() != null) {
                      getOnItemSelectedListener().onNothingSelected(parent);
                  }
              }
  
          };
      }
docs: Creates and returns a listener, which allows to validate the value of the view, when the
  selected item has been changed.
  
  @return The listener, which has been created, as an instance of the type {@link
  OnItemSelectedListener}