我觉得它对一个排行榜很好,无论哪个板,我自己称之为。当我想要显示所有电路板时,我在下面打电话。它显示了最后一个只调用的电路板。我理解这一点,我想知道的是有一种方法可以在不调用一个引导板的情况下直接调用引导板,这样用户就可以相互比较分数了吗?
private void signToLeaderBoard() {
if (mGoogleApiClient.isConnected()) {
startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mGoogleApiClient,
context.getString(R.string.leaderboard_game_high_score)), 1);
startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mGoogleApiClient,
context.getString(R.string.leaderboard_total_high_score)),1);
startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mGoogleApiClient,
context.getString(R.string.leaderboard_grab_a_word_count)), 1);
} else {
// make dialog asking to sign in
}
}
答案 0 :(得分:1)
好吧,我想如果我花更多的时间研究答案,我就可以节省时间来提问。我已经对下面的代码进行了更改。而且效果很好。
private static final int RC_UNUSED = 5001;
private void signToLeaderBoard() {
if (mGoogleApiClient.isConnected()) {
startActivityForResult(Games.Leaderboards.getAllLeaderboardsIntent(mGoogleApiClient),
RC_UNUSED);
// startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mGoogleApiClient,
// context.getString(R.string.leaderboard_game_high_score)), 1);
} else {
// make dialog asking to sign in
}
}