【发布时间】:2017-02-18 20:29:45
【问题描述】:
我使用此代码从排行榜中获得最高分,但我一直在获得
java.lang.IllegalStateException
在
LeaderboardScore lbs = arg0.getScores().get(0);
我不知道出了什么问题。它在我以前的项目中起作用
public void updateTops() {
Games.Leaderboards.loadTopScores(client, getString(R.string.leaderboard_score),
LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC, 2, true).
setResultCallback(new ResultCallback<Leaderboards.LoadScoresResult>() {
@Override
public void onResult(final Leaderboards.LoadScoresResult arg0) {
System.out.println("SUKA " + score);
LeaderboardScore lbs = arg0.getScores().get(0);
score = lbs.getDisplayScore();
name = lbs.getScoreHolderDisplayName();
arg0.getScores().close();
}
});
}
【问题讨论】:
标签: android libgdx google-play-services