title: Google Games: Gingerbread w/ Multiple G+ Accounts > Indefinite Sign-In Loop - GameHelper
body: <p>With Google Play Game Services samples, If you use a Gingerbread device that has multiple Google Accounts, you cannot sign in. GameHelper fails to sign-in and you get stuck in a never ending "sign-in screen" loop.</p>
  
  <p>If you open GameHelper.java and comment out line 417: mExpectingResolution = false;</p>
  
  <p>..then you can actually log in. But this also causes my game to crash.</p>
  
  <p>Google Play Services and a new class GameHelper with an example ButtonClicker2000 on android 2.3 can not log in to your account. When a dialog box (sign-in dialog) appears with the user's choice, the method onStop(). </p>
  
  <pre><code>/** 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;
  }
  </code></pre>
  
  <p>After selecting the user calls the onStart(). However, there is no sign-in. Instead Development dialog box (sign-in dialog) reappears with the user's choice. And so indefinitely.</p>
  
  <pre><code>/** 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);
      }
  }
  </code></pre>
  
  <p>Is there any fix for the log-in loop bug in GameHelper?</p>
  
  <p>The source is here: <a href="https://github.com/playgameservices/android-basic-samples" rel="nofollow">https://github.com/playgameservices/android-basic-samples</a></p>