使用Google Play游戏服务示例,如果您使用具有多个Google帐户的Gingerbread设备,则无法登录.GameHelper无法登录,您将陷入永无止境的登录屏幕&# 34;循环。
如果您打开GameHelper.java并注释掉第417行:mExpectingResolution = false;
..然后你可以实际登录。但这也会导致我的游戏崩溃。
Google Play服务和一个新类GameHelper以及Android 2.3上的ButtonClicker2000示例无法登录到您的帐户。当用户选择出现一个对话框(登录对话框)时,方法onStop()。
/** Call this method from your Activity's onStop(). */
public void onStop() {
debugLog("onStop");
assertConfigured("onStop");
if (mGoogleApiClient.isConnected()) {
debugLog("Disconnecting client due to onStop");
mGoogleApiClient.disconnect();
} else {
debugLog("Client already disconnected when we got onStop.");
}
mConnecting = false;
mExpectingResolution = false;
// let go of the Activity reference
mActivity = null;
}
选择用户后调用onStart()。但是,没有登录。相反,开发对话框(登录对话框)会随用户的选择重新出现。如此无限期。
/** Call this method from your Activity's onStart(). */
public void onStart(Activity act) {
mActivity = act;
mAppContext = act.getApplicationContext();
debugLog("onStart");
assertConfigured("onStart");
if (mConnectOnStart) {
if (mGoogleApiClient.isConnected()) {
Log.w(TAG,
"GameHelper: client was already connected on onStart()");
} else {
debugLog("Connecting client.");
mConnecting = true;
mGoogleApiClient.connect();
}
} else {
debugLog("Not attempting to connect becase mConnectOnStart=false");
debugLog("Instead, reporting a sign-in failure.");
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
notifyListener(false);
}
}, 1000);
}
}
GameHelper中的登录循环错误是否有任何修复?
来源位于:https://github.com/playgameservices/android-basic-samples