0

Google Play ゲーム サービスのサンプルでは、​​複数の Google アカウントを持つ Gingerbread デバイスを使用している場合、サインインできません。GameHelper はサインインに失敗し、終わりのない「サインイン画面」ループに陥ります。

GameHelper.java を開いて 417 行目をコメントアウトすると、次のようになります。

..その後、実際にログインできます。しかし、これによりゲームがクラッシュすることもあります。

Android 2.3 の例として ButtonClicker2000 を使用した Google Play Services と新しいクラスの GameHelper は、アカウントにログインできません。ユーザーが選択したダイアログ ボックス (サインイン ダイアログ) が表示されたら、メソッド 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

4

0 に答える 0