예제 #1
0
  private void callDialogListener(Bundle values, FacebookException error) {
    if (mListener == null) {
      return;
    }

    if (values != null) {
      mListener.onComplete(values);
    } else {
      if (error instanceof FacebookDialogException) {
        FacebookDialogException facebookDialogException = (FacebookDialogException) error;
        DialogError dialogError =
            new DialogError(
                facebookDialogException.getMessage(),
                facebookDialogException.getErrorCode(),
                facebookDialogException.getFailingUrl());
        mListener.onError(dialogError);
      } else if (error instanceof FacebookOperationCanceledException) {
        mListener.onCancel();
      } else {
        FacebookError facebookError = new FacebookError(error.getMessage());
        mListener.onFacebookError(facebookError);
      }
    }
  }
예제 #2
0
 @Override
 public void onBackPressed() {
   mListener.onCancel();
   super.onBackPressed();
 }