【发布时间】:2025-12-04 19:00:02
【问题描述】:
我正在将我的游戏更新到新的 Google Play Serviced 库,排行榜和成就已经完美运行,但是现在当我尝试打开成就活动时,它会立即关闭,而不会在 logcat 中显示任何异常。 我使用我的 google 帐户登录,该帐户已正确配置为测试用户。
public void gameServicesGetAchievements() {
if (gameHelper == null)
return;
Intent i = Games.Achievements.getAchievementsIntent(gameHelper.getApiClient());
((Activity) ctx).startActivityForResult(i, REQUEST_CODE_ACHIEVEMENTS);
}
活动打开,但在显示成就列表之前立即关闭。这就是我在 logcat 中得到的
D/GameHelper(30459): GameHelper: onActivityResult: req=9802, resp=RESULT_RECONNECT_REQUIRED
D/GameHelper(30459): GameHelper: onActivityResult: request code not meant for us. Ignoring.
我尝试在 onActivityResult 中处理 RESULT_RECONNECT_REQUIRED 代码,但没有任何变化。
@Override
public void onActivityResult(int request, int response, Intent data) {
super.onActivityResult(request, response, data);
GameHelper helper = resolver.getGameServicesHelper();
if (helper != null) {
helper.onActivityResult(request, response, data);
}
if (response == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
helper.disconnect();
}
}
排行榜活动正确启动并完美运行。
【问题讨论】:
标签: android google-play-services google-play-games