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


Java GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED屬性代碼示例

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


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

示例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:alcacoop,項目名稱:it.alcacoop.fourinaline,代碼行數:20,代碼來源:GameHelperUtils.java

示例4: handleAchievementsUIRequest

private void handleAchievementsUIRequest( int resultCode ) {
	/* UI was not shown, client in inconsistent state, needs reconnect */
	if( resultCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED ) {
		AIR.log( "GameServices | client must be reconnected before showing achievements UI" );
		mPendingAchievementsUI = true;
		mGoogleApiClient.reconnect();
	} else {
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UI_HIDE );
	}
}
 
開發者ID:marpies,項目名稱:game-services-ane,代碼行數:10,代碼來源:GameServicesHelper.java

示例5: handleLeaderboardsUIRequest

private void handleLeaderboardsUIRequest( int resultCode ) {
	/* UI was not shown, client in inconsistent state, needs reconnect */
	if( resultCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED ) {
		AIR.log( "GameServices | client must be reconnected before showing leaderboards UI" );
		mPendingLeaderboardsUI = true;
		mGoogleApiClient.reconnect();
	} else {
		mPendingLeaderboardId = null;
		AIR.dispatchEvent( GameServicesEvent.LEADERBOARDS_UI_HIDE );
	}
}
 
開發者ID:marpies,項目名稱:game-services-ane,代碼行數:11,代碼來源:GameServicesHelper.java

示例6: onActivityResult

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    helper.onActivityResult(requestCode, resultCode, data);
    if (multiplayer != null) {
        multiplayer.onActivityResult(requestCode, resultCode, data);
    }
    if ((requestCode == GoogleAchievements.ACHIEVEMENTS_REQUEST_CODE
        || requestCode == LEADERBOARD_REQUEST_CODE)
        && resultCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        onSignedOutFromOutside();
    }
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:GameServicesHelper.java

示例7: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(int requestCode, int responseCode,
                             Intent intent) {
    debugLog("onActivityResult: req="
            + (requestCode == RC_RESOLVE ? "RC_RESOLVE" : String
            .valueOf(requestCode)) + ", resp="
            + GameHelperUtils.activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE) {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    mExpectingResolution = false;

    if (!mConnecting) {
        debugLog("onActivityResult: ignoring because we are not connecting.");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK) {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connect();
    } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connect();
    } else if (responseCode == Activity.RESULT_CANCELED) {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        mSignInCancelled = true;
        mConnectOnStart = false;
        mUserInitiatedSignIn = false;
        mSignInFailureReason = null; // cancelling is not a failure!
        mConnecting = false;
        mGoogleApiClient.disconnect();

        // increment # of cancellations
        int prevCancellations = getSignInCancellations();
        int newCancellations = incrementSignInCancellations();
        debugLog("onAR: # of cancellations " + prevCancellations + " --> "
                + newCancellations + ", max " + mMaxAutoSignInAttempts);

        notifyListener(false);
    } else {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode="
                + GameHelperUtils
                .activityResponseCodeToString(responseCode)
                + ", so giving up.");
        giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(),
                responseCode));
    }
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:61,代碼來源:GameHelper.java

示例8: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(
    int requestCode, int responseCode,
    Intent intent)
{
    debugLog("onActivityResult: req="
        + (
        requestCode == RC_RESOLVE ? "RC_RESOLVE" : String
            .valueOf(requestCode)) + ", resp="
        + GameHelperUtils.activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE)
    {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    this.mExpectingResolution = false;

    if (!this.mConnecting)
    {
        debugLog("onActivityResult: ignoring because we are not connecting.");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK)
    {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connect();
    }
    else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED)
    {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connect();
    }
    else if (responseCode == Activity.RESULT_CANCELED)
    {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        this.mSignInCancelled = true;
        this.mConnectOnStart = false;
        this.mUserInitiatedSignIn = false;
        this.mSignInFailureReason = null; // cancelling is not a failure!
        this.mConnecting = false;
        this.mGoogleApiClient.disconnect();

        // increment # of cancellations
        int prevCancellations = getSignInCancellations();
        int newCancellations = incrementSignInCancellations();
        debugLog("onAR: # of cancellations " + prevCancellations + " --> "
            + newCancellations + ", max " + this.mMaxAutoSignInAttempts);

        notifyListener(false);
    }
    else
    {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode="
            + GameHelperUtils
            .activityResponseCodeToString(responseCode)
            + ", so giving up.");
        giveUp(new SignInFailureReason(
            this.mConnectionResult.getErrorCode(),
            responseCode));
    }
}
 
開發者ID:overengineering,項目名稱:space-travels-3,代碼行數:74,代碼來源:GameHelper.java

示例9: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(int requestCode, int responseCode, Intent intent) {
    debugLog("onActivityResult: req=" + (requestCode == RC_RESOLVE ? "RC_RESOLVE" :
            String.valueOf(requestCode)) + ", resp=" +
            activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE) {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    mExpectingResolution = false;

    if (mState != STATE_CONNECTING) {
        debugLog("onActivityResult: ignoring because state isn't STATE_CONNECTING (" +
                "it's " + STATE_NAMES[mState] + ")");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK) {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connectCurrentClient();
    } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connectCurrentClient();
    } else if (responseCode == Activity.RESULT_CANCELED) {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        mAutoSignIn = false;
        mUserInitiatedSignIn = false;
        mSignInFailureReason = null; // cancelling is not a failure!
        killConnections();
        notifyListener(false);
    } else {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode=" + activityResponseCodeToString(responseCode) +
                ", so giving up.");
        giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(), responseCode));
    }
}
 
開發者ID:kebernet,項目名稱:shortyz,代碼行數:48,代碼來源:GameHelper.java

示例10: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(int requestCode, int responseCode, Intent intent) {
    debugLog("onActivityResult: req=" + (requestCode == RC_RESOLVE ? "RC_RESOLVE" :
            String.valueOf(requestCode)) + ", resp=" +
            activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE) {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    mExpectingResolution = false;

    if (mState != STATE_CONNECTING) {
        debugLog("onActivityResult: ignoring because state isn't STATE_CONNECTING (" +
                "it's " + STATE_NAMES[mState] + ")");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK) {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connectCurrentClient();
    } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connectCurrentClient();
    } else if (responseCode == Activity.RESULT_CANCELED) {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        mAutoSignIn = false;
        mUserInitiatedSignIn = false;
        mSignInFailureReason = null; // cancelling is not a failure!
        killConnections();
        notifyListener(false);
    } else {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode="  + activityResponseCodeToString(responseCode) +
                    ", so giving up.");
        giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(), responseCode));
    }
}
 
開發者ID:Lunarsong,項目名稱:NativeActivity,代碼行數:48,代碼來源:GameHelper.java

示例11: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(int requestCode, int responseCode,
        Intent intent) {
    debugLog("onActivityResult: req="
            + (requestCode == RC_RESOLVE ? "RC_RESOLVE" : String
                    .valueOf(requestCode)) + ", resp="
            + GameHelperUtils.activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE) {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    mExpectingResolution = false;

    if (!mConnecting) {
        debugLog("onActivityResult: ignoring because we are not connecting.");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK) {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connect();
    } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connect();
    } else if (responseCode == Activity.RESULT_CANCELED) {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        mSignInCancelled = true;
        mConnectOnStart = false;
        mUserInitiatedSignIn = false;
        mSignInFailureReason = null; // cancelling is not a failure!
        mConnecting = false;
        mGoogleApiClient.disconnect();

        // increment # of cancellations
        int prevCancellations = getSignInCancellations();
        int newCancellations = incrementSignInCancellations();
        debugLog("onAR: # of cancellations " + prevCancellations + " --> "
                + newCancellations + ", max " + mMaxAutoSignInAttempts);

        notifyListener(false);
    } else {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode="
                + GameHelperUtils
                        .activityResponseCodeToString(responseCode)
                + ", so giving up.");
        giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(),
                responseCode));
    }
}
 
開發者ID:googlesamples,項目名稱:io2014-codelabs,代碼行數:61,代碼來源:GameHelper.java

示例12: onActivityResult

/**
* Handle activity result. Call this method from your Activity's
* onActivityResult callback. If the activity result pertains to the sign-in
* process, processes it appropriately.
*/
public void onActivityResult(int requestCode, int responseCode, Intent intent) {
    debugLog("onActivityResult: req=" + (requestCode == RC_RESOLVE ? "RC_RESOLVE" :
    String.valueOf(requestCode)) + ", resp=" +
    activityResponseCodeToString(responseCode));
    if (requestCode != RC_RESOLVE) {
        debugLog("onActivityResult: request code not meant for us. Ignoring.");
        return;
    }

    // no longer expecting a resolution
    mExpectingResolution = false;

    if (mState != STATE_CONNECTING) {
        debugLog("onActivityResult: ignoring because state isn't STATE_CONNECTING (" +
        "it's " + STATE_NAMES[mState] + ")");
        return;
    }

    // We're coming back from an activity that was launched to resolve a
    // connection problem. For example, the sign-in UI.
    if (responseCode == Activity.RESULT_OK) {
        // Ready to try to connect again.
        debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
        connectCurrentClient();
    } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
        connectCurrentClient();
    } else if (responseCode == Activity.RESULT_CANCELED) {
        // User cancelled.
        debugLog("onAR: Got a cancellation result, so disconnecting.");
        mAutoSignIn = false;
        mUserInitiatedSignIn = false;
        mSignInFailureReason = null; // cancelling is not a failure!
        killConnections();
        notifyListener(false);
    } else {
        // Whatever the problem we were trying to solve, it was not
        // solved. So give up and show an error message.
        debugLog("onAR: responseCode="  + activityResponseCodeToString(responseCode) +
        ", so giving up.");
        giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(), responseCode));
    }
}
 
開發者ID:ldarren,項目名稱:pico-phonegap-base,代碼行數:48,代碼來源:GmsHelper.java

示例13: onActivityResult

/**
 * Handle activity result. Call this method from your Activity's
 * onActivityResult callback. If the activity result pertains to the sign-in
 * process, processes it appropriately.
 */
public void onActivityResult(int requestCode, int responseCode,
    Intent intent) {
  debugLog("onActivityResult: req="
      + (requestCode == RC_RESOLVE ? "RC_RESOLVE" : String
          .valueOf(requestCode)) + ", resp="
      + GameHelperUtils.activityResponseCodeToString(responseCode));
  if (requestCode != RC_RESOLVE) {
    debugLog("onActivityResult: request code not meant for us. Ignoring.");
    return;
  }

  // no longer expecting a resolution
  mExpectingResolution = false;

  if (!mConnecting) {
    debugLog("onActivityResult: ignoring because we are not connecting.");
    return;
  }

  // We're coming back from an activity that was launched to resolve a
  // connection problem. For example, the sign-in UI.
  if (responseCode == Activity.RESULT_OK) {
    // Ready to try to connect again.
    debugLog("onAR: Resolution was RESULT_OK, so connecting current client again.");
    connect();
  } else if (responseCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
    debugLog("onAR: Resolution was RECONNECT_REQUIRED, so reconnecting.");
    connect();
  } else if (responseCode == Activity.RESULT_CANCELED) {
    // User cancelled.
    debugLog("onAR: Got a cancellation result, so disconnecting.");
    mSignInCancelled = true;
    mConnectOnStart = false;
    mUserInitiatedSignIn = false;
    mSignInFailureReason = null; // cancelling is not a failure!
    mConnecting = false;
    mGoogleApiClient.disconnect();

    // increment # of cancellations
    int prevCancellations = getSignInCancellations();
    int newCancellations = incrementSignInCancellations();
    debugLog("onAR: # of cancellations " + prevCancellations + " --> "
        + newCancellations + ", max " + mMaxAutoSignInAttempts);

    notifyListener(false);
  } else {
    // Whatever the problem we were trying to solve, it was not
    // solved. So give up and show an error message.
    debugLog("onAR: responseCode="
        + GameHelperUtils
            .activityResponseCodeToString(responseCode)
        + ", so giving up.");
    giveUp(new SignInFailureReason(mConnectionResult.getErrorCode(),
        responseCode));
  }
}
 
開發者ID:alcacoop,項目名稱:it.alcacoop.fourinaline,代碼行數:61,代碼來源:GServiceGameHelper.java


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