code: void tryFinish() {
          // Return the RESULT_CANCELED result code if an has error occurred.
          if (mHasErrorOccurred) {
              setResult(RESULT_CANCELED);
              finish();
              return;
          }
  
          // Return the results if all settings are filled.
          if (mDestinationId != FacebookEndpoint.DestinationId.UNLINKED && mAccountName != null &&
                  mAlbumName != null && mAlbumGraphPath != null) {
              FacebookSettings settings = FacebookSettings.newInstance(mDestinationId, mAccountName,
                      mAlbumName, mAlbumGraphPath, mPageAccessToken, mPhotoPrivacy);
              if (settings != null) {
                  Intent result = new Intent();
                  result.putExtras(settings.toBundle());
                  setResult(RESULT_OK, result);
              } else {
                  setResult(RESULT_CANCELED);
              }
              finish();
          }
      }
docs: Finish the {@link FacebookSettingsActivity} if the conditions are met.