示例#1
0
  @Override
  public void onConnectionFailed(ConnectionResult connectionResult) {
    if (mResolvingConnectionFailure) {
      // already resolving
      return;
    }

    // if the sign-in button was clicked or if auto sign-in is enabled,
    // launch the sign-in flow
    if (mSignInClicked || mAutoStartSignInFlow) {
      mAutoStartSignInFlow = false;
      mSignInClicked = false;
      mResolvingConnectionFailure = true;

      // Attempt to resolve the connection failure using BaseGameUtils.
      // The R.string.signin_other_error value should reference a generic
      // error string in your strings.xml file, such as "There was
      // an issue with sign-in, please try again later."

      if (!BaseGameUtils.resolveConnectionFailure(
          this, mGoogleApiClient, connectionResult, RC_SIGN_IN, "error")) {
        mResolvingConnectionFailure = false;
      }
    }
  }
 void showGameError() {
   BaseGameUtils.makeSimpleDialog(this, "error");
 }