當前位置: 首頁>>代碼示例>>Java>>正文


Java GamesActivityResultCodes.RESULT_LICENSE_FAILED屬性代碼示例

本文整理匯總了Java中com.google.android.gms.games.GamesActivityResultCodes.RESULT_LICENSE_FAILED屬性的典型用法代碼示例。如果您正苦於以下問題:Java GamesActivityResultCodes.RESULT_LICENSE_FAILED屬性的具體用法?Java GamesActivityResultCodes.RESULT_LICENSE_FAILED怎麽用?Java GamesActivityResultCodes.RESULT_LICENSE_FAILED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.android.gms.games.GamesActivityResultCodes的用法示例。


在下文中一共展示了GamesActivityResultCodes.RESULT_LICENSE_FAILED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: activityResponseCodeToString

static String activityResponseCodeToString(int respCode) {
    switch (respCode) {
        case Activity.RESULT_OK:
            return "RESULT_OK";
        case Activity.RESULT_CANCELED:
            return "RESULT_CANCELED";
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            return "RESULT_APP_MISCONFIGURED";
        case GamesActivityResultCodes.RESULT_LEFT_ROOM:
            return "RESULT_LEFT_ROOM";
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            return "RESULT_LICENSE_FAILED";
        case GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED:
            return "RESULT_RECONNECT_REQUIRED";
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            return "SIGN_IN_FAILED";
        default:
            return String.valueOf(respCode);
    }
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:20,代碼來源:GameHelperUtils.java

示例2: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *  @param activity the Activity in which the Dialog should be displayed.
 * @param requestCode the request code from onActivityResult.
 * @param actResp the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorDescription) {
    if (activity == null) {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.app_misconfigured));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            final int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, requestCode, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("BaseGamesUtils",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity, activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:MartensCedric,項目名稱:Hexpert,代碼行數:43,代碼來源:BaseGameUtils.java

示例3: activityResponseCodeToString

static String activityResponseCodeToString(int respCode) {
    switch (respCode) {
        case Activity.RESULT_OK:
        return "RESULT_OK";
        case Activity.RESULT_CANCELED:
        return "RESULT_CANCELED";
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
        return "RESULT_APP_MISCONFIGURED";
        case GamesActivityResultCodes.RESULT_LEFT_ROOM:
        return "RESULT_LEFT_ROOM";
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
        return "RESULT_LICENSE_FAILED";
        case GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED:
        return "RESULT_RECONNECT_REQUIRED";
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
        return "SIGN_IN_FAILED";
        default:
        return String.valueOf(respCode);
    }
}
 
開發者ID:ldarren,項目名稱:pico-phonegap-base,代碼行數:20,代碼來源:GmsHelper.java

示例4: activityResponseCodeToString

static String activityResponseCodeToString(int respCode) {
  switch (respCode) {
    case Activity.RESULT_OK:
      return "RESULT_OK";
    case Activity.RESULT_CANCELED:
      return "RESULT_CANCELED";
    case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
      return "RESULT_APP_MISCONFIGURED";
    case GamesActivityResultCodes.RESULT_LEFT_ROOM:
      return "RESULT_LEFT_ROOM";
    case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
      return "RESULT_LICENSE_FAILED";
    case GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED:
      return "RESULT_RECONNECT_REQUIRED";
    case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
      return "SIGN_IN_FAILED";
    default:
      return String.valueOf(respCode);
  }
}
 
開發者ID:alcacoop,項目名稱:it.alcacoop.fourinaline,代碼行數:20,代碼來源:GameHelperUtils.java

示例5: showFailureDialog

/**
 * Shows an error dialog that's appropriate for the failure reason.
 */
public static void showFailureDialog(Activity activity, int actResp,
                                     int errorCode) {
    if (activity == null) {
        Log.e("GameHelper", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog = null;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_APP_MISCONFIGURED));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_SIGN_IN_FAILED));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_LICENSE_FAILED));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, RC_UNUSED, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("GameHelper",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(
                        activity,
                        GameHelperUtils.getString(activity,
                                GameHelperUtils.R_UNKNOWN_ERROR)
                                + " "
                                + GameHelperUtils.errorCodeToString(errorCode));
            }
    }

    errorDialog.show();
}
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:44,代碼來源:GameHelper.java

示例6: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *
 * @param activity         the Activity in which the Dialog should be displayed.
 * @param requestCode      the request code from onActivityResult.
 * @param actResp          the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorDescription) {
    if (activity == null) {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.app_misconfigured));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            final int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, requestCode, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("BaseGamesUtils",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity, activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:44,代碼來源:BaseGameUtils.java

示例7: showActivityResultError

/**
 * Show a {@link Dialog} with the correct message for a connection error.
 *  @param activity the Activity in which the Dialog should be displayed.
 * @param requestCode the request code from onActivityResult.
 * @param actResp the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorDescription) {
    if (activity == null) {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity,"app misconfigured");
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity,"signin failed");
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity,"license failed");
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            final int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, requestCode, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("BaseGamesUtils",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity, activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:Augugrumi,項目名稱:SpaceRace,代碼行數:40,代碼來源:BaseGameUtils.java

示例8: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *  @param activity the Activity in which the Dialog should be displayed.
 * @param requestCode the request code from onActivityResult.
 * @param actResp the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorDescription) {
    if (activity == null) {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.app_misconfigured));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            final int errorCode = GooglePlayServicesUtil
                            .isGooglePlayServicesAvailable(activity);
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, requestCode, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("BaseGamesUtils",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity,
                        activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:playgameservices,項目名稱:8bitartist,代碼行數:45,代碼來源:BaseGameUtils.java

示例9: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *
 * @param activity         the Activity in which the Dialog should be displayed.
 * @param requestCode      the request code from onActivityResult.
 * @param actResp          the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorDescription) {
  if (activity == null) {
    Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
    return;
  }
  Dialog errorDialog;

  switch (actResp) {
    case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
      errorDialog = makeSimpleDialog(activity,
          activity.getString(R.string.app_misconfigured));
      break;
    case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
      errorDialog = makeSimpleDialog(activity,
          activity.getString(R.string.sign_in_failed));
      break;
    case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
      errorDialog = makeSimpleDialog(activity,
          activity.getString(R.string.license_failed));
      break;
    default:
      // No meaningful Activity response code, so generate default Google
      // Play services dialog
      final int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
      errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
          activity, requestCode, null);
      if (errorDialog == null) {
        // get fallback dialog
        Log.e("BaseGamesUtils",
            "No standard error dialog available. Making fallback dialog.");
        errorDialog = makeSimpleDialog(activity, activity.getString(errorDescription));
      }
  }

  errorDialog.show();
}
 
開發者ID:micabytes,項目名稱:lib_game,代碼行數:44,代碼來源:GameUtils.java

示例10: showFailureDialog

/** Shows an error dialog that's appropriate for the failure reason. */
public static void showFailureDialog(Activity activity, int actResp,
                                     int errorCode) {
    if (activity == null) {
        Log.e("GameHelper", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog = null;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_APP_MISCONFIGURED));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_SIGN_IN_FAILED));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                    activity, GameHelperUtils.R_LICENSE_FAILED));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, RC_UNUSED, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("GameHelper",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(
                        activity,
                        GameHelperUtils.getString(activity,
                                GameHelperUtils.R_UNKNOWN_ERROR)
                                + " "
                                + GameHelperUtils.errorCodeToString(errorCode));
            }
    }

    errorDialog.show();
}
 
開發者ID:Augugrumi,項目名稱:SpaceRace,代碼行數:42,代碼來源:GameHelper.java

示例11: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *
 * @param activity         the Activity in which the Dialog should be displayed.
 * @param requestCode      the request code from onActivityResult.
 * @param actResp          the response code from onActivityResult.
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(
    Activity activity,
    int requestCode,
    int actResp,
    int errorDescription)
{
    if (activity == null)
    {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp)
    {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(
                activity,
                activity.getString(R.string.gamehelper_app_misconfigured));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(
                activity,
                activity.getString(R.string.gamehelper_sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(
                activity,
                activity.getString(R.string.gamehelper_license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            final int errorCode =
                GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                activity, requestCode, null);
            if (errorDialog == null)
            {
                // get fallback dialog
                Log.e(
                    "BaseGamesUtils",
                    "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity, activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:overengineering,項目名稱:space-travels-3,代碼行數:57,代碼來源:BaseGameUtils.java

示例12: showFailureDialog

/** Shows an error dialog that's appropriate for the failure reason. */
void showFailureDialog() {
    Context ctx = getContext();
    if (ctx == null) {
        debugLog("*** No context. Can't show failure dialog.");
        return;
    }
    debugLog("Making error dialog for failure: " + mSignInFailureReason);
    Dialog errorDialog = null;
    int errorCode = mSignInFailureReason.getServiceErrorCode();
    int actResp = mSignInFailureReason.getActivityResultCode();

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(ctx.getString(
                    R.string.gamehelper_app_misconfigured));
            printMisconfiguredDebugInfo();
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(ctx.getString(
                    R.string.gamehelper_sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(ctx.getString(
                    R.string.gamehelper_license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, mActivity,
                    RC_UNUSED, null);
            if (errorDialog == null) {
                // get fallback dialog
                debugLog("No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(ctx.getString(R.string.gamehelper_unknown_error)
                        + " " + errorCodeToString(errorCode));
            }
    }

    debugLog("Showing error dialog.");
    errorDialog.show();
}
 
開發者ID:kebernet,項目名稱:shortyz,代碼行數:42,代碼來源:GameHelper.java

示例13: showFailureDialog

/** Shows an error dialog that's appropriate for the failure reason. */
public static void showFailureDialog(Activity activity, int actResp,
        int errorCode) {
    if (activity == null) {
        Log.e("GameHelper", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog = null;

    switch (actResp) {
    case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
        errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                activity, GameHelperUtils.R_APP_MISCONFIGURED));
        break;
    case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
        errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                activity, GameHelperUtils.R_SIGN_IN_FAILED));
        break;
    case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
        errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
                activity, GameHelperUtils.R_LICENSE_FAILED));
        break;
    default:
        // No meaningful Activity response code, so generate default Google
        // Play services dialog
        errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                activity, RC_UNUSED, null);
        if (errorDialog == null) {
            // get fallback dialog
            Log.e("GameHelper",
                    "No standard error dialog available. Making fallback dialog.");
            errorDialog = makeSimpleDialog(
                    activity,
                    GameHelperUtils.getString(activity,
                            GameHelperUtils.R_UNKNOWN_ERROR)
                            + " "
                            + GameHelperUtils.errorCodeToString(errorCode));
        }
    }

    errorDialog.show();
}
 
開發者ID:googlesamples,項目名稱:io2014-codelabs,代碼行數:42,代碼來源:GameHelper.java

示例14: showActivityResultError

/**
 * Show a {@link android.app.Dialog} with the correct message for a connection error.
 *
 * @param activity the Activity in which the Dialog should be displayed.
 * @param requestCode the request code from onActivityResult.
 * @param actResp the response code from onActivityResult.
 * @param errorCode the resource id of a String for an 'Unable to sign in' error message,
 * @param errorDescription the resource id of a String for a generic error message.
 */
public static void showActivityResultError(Activity activity, int requestCode, int actResp,
                                           int errorCode, int errorDescription) {
    if (activity == null) {
        Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog;

    switch (actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.gamehelper_app_misconfigured));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.gamehelper_sign_in_failed));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity,
                    activity.getString(R.string.gamehelper_license_failed));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                    activity, requestCode, null);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("BaseGamesUtils",
                        "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(
                        activity,
                        activity.getString(errorCode)
                                + " "
                                + activity.getString(errorDescription));
            }
    }

    errorDialog.show();
}
 
開發者ID:Dwite,項目名稱:BiggerSmaller,代碼行數:49,代碼來源:BaseGameUtils.java

示例15: showFailureDialog

/** Shows an error dialog that's appropriate for the failure reason. */
public static void showFailureDialog(Activity activity, int actResp,
    int errorCode) {
  if (activity == null) {
    Log.e("GameHelper", "*** No Activity. Can't show failure dialog!");
    return;
  }
  Dialog errorDialog = null;

  switch (actResp) {
    case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
      errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
          activity, GameHelperUtils.R_APP_MISCONFIGURED));
      break;
    case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
      errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
          activity, GameHelperUtils.R_SIGN_IN_FAILED));
      break;
    case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
      errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(
          activity, GameHelperUtils.R_LICENSE_FAILED));
      break;
    default:
      // No meaningful Activity response code, so generate default Google
      // Play services dialog
      errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
          activity, RC_UNUSED, null);
      if (errorDialog == null) {
        // get fallback dialog
        Log.e("GameHelper",
            "No standard error dialog available. Making fallback dialog.");
        errorDialog = makeSimpleDialog(
            activity,
            GameHelperUtils.getString(activity,
                GameHelperUtils.R_UNKNOWN_ERROR)
                + " "
                + GameHelperUtils.errorCodeToString(errorCode));
      }
  }

  errorDialog.show();
}
 
開發者ID:alcacoop,項目名稱:it.alcacoop.fourinaline,代碼行數:42,代碼來源:GServiceGameHelper.java


注:本文中的com.google.android.gms.games.GamesActivityResultCodes.RESULT_LICENSE_FAILED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。