code: private OnClickListener createRemovePreferenceHeaderClickListener() {
          return new OnClickListener() {
  
              @Override
              public void onClick(final DialogInterface dialog, final int which) {
                  int position = spinner.getSelectedItemPosition();
                  listener.onRemovePreferenceHeader(position);
              }
  
          };
      }
docs: Creates and returns a listener, which allows to notify the registered listener, when the user
  closes the dialog confirmatively.
  
  @return The listener, which has been created, as an instance of the type {@link
  OnClickListener}