code: private OnClickListener createFinishButtonListener() {
          return new OnClickListener() {
  
              @Override
              public void onClick(final View v) {
                  int selectedIndex = viewPager.getCurrentItem();
  
                  if (notifyOnFinish(selectedIndex)) {
                      getDialog().dismiss();
                  }
              }
  
          };
      }
docs: Creates and returns a listener, which allows to close the dialog, when the corresponding
  button is clicked.
  
  @return The listener, which has been created, as an instance of the type {@link
  OnClickListener}