Roger Belk
Roger Belk

Reputation: 309

Google play services leader board not showing

I have it showing fine for one leader board, whatever board, I call it by itself. When I want to show all of the boards I make the call below. It shows the last board called only. I understand this, what I want to know is there a way to just call the leader boards without calling one at a time so the user can compare the scores to each other?

 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
    }
}

Upvotes: 0

Views: 210

Answers (1)

Roger Belk
Roger Belk

Reputation: 309

Ok, I guess if I spent more time researching for an answer I'd saved myself time asking the question. I have made the changes to the code below. and it works great.

 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
    }
}

enter image description here

Upvotes: 1

Related Questions