0

我正在尝试使用 GoogleApiClient,当我尝试登录应用程序而不是反复登录时询问选择帐户。我无法找出解决方案。 https://drive.google.com/file/d/0B60egT7coPSETTJhTHZjOC1IdGs/view?usp=sharing这个链接显示了应用程序的行为

这是我使用的代码

mGoogleApiClient = new GoogleApiClient.Builder(this)
                      .addConnectionCallbacks(this)
                      .addOnConnectionFailedListener(this)
                      .addApi(Games.API).addScope(Games.SCOPE_GAMES)
                    // add other APIs and scopes here as needed
                      .build();
4

1 回答 1

0

当扩展类BaseGameActivity覆盖的方法未在onActivityResult中调用时,通常会出现此问题。请确保您的代码在调用活动的 onActivityResult 中被调用。

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
 super.onActivityResult(requestCode, resultCode, data);
 ....
 put all your methods/code here
}

看一下 BaseGameActivity 的代码 GameHelper 调用 onActivityResult 传递所有必要的参数以及意图。

也试试这些:

  • 清除您的 cookie
  • 清除缓存
  • 确保您的系统时间正确。
于 2015-10-05T23:11:05.540 回答