コード例 #1
0
 /**
  * Called when a failure occurs trying to authenticate or refresh.
  *
  * @param info The last authentication information available, before the exception.
  * @param ex the exception that occurred.
  */
 @Override
 public void onAuthFailure(BoxAuthentication.BoxAuthenticationInfo info, Exception ex) {
   if (sameUser(info) || (info == null && getUserId() == null)) {
     if (sessionAuthListener != null) {
       sessionAuthListener.onAuthFailure(info, ex);
     }
     if (ex instanceof BoxException) {
       BoxException.ErrorType errorType = ((BoxException) ex).getErrorType();
       switch (errorType) {
         case NETWORK_ERROR:
           toastString(mApplicationContext, R.string.boxsdk_error_network_connection);
       }
     }
   }
 }