Games.Leaderboards.loadPlayerCenteredScores(mGoogleApiClient,leaderboardId, LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC, 5).setResultCallback(new ResultCallback<Leaderboards.LoadScoresResult>()
    public void onResult(Leaderboards.LoadScoresResult arg0) {
    // TODO Auto-generated method stub

       int size = arg0.getScores().getCount();
        Log.e("ACHGOD", "SIZE="+Integer.toString(size));

        for (int i = 0; i < 3; i++) {
            LeaderboardScore lbs = arg0.getScores().get(i);
            // String name = lbs.getScoreHolderDisplayName();
            String score = lbs.getDisplayScore();
            Log.e("ACHGOD", "SCORE="+score);
            //Uri urlimage = lbs.getScoreHolderHiResImageUri();
        // arg0.getScores().close();

I am getting the integer score value here. But, I could not find any proper documentation regarding the score value, which I get.

Is it the high score? Or, is it the last submitted score? I am looking to get the highest score made by the currently logged-in user from the leaderboard.

Thanks in advance.


1 Answer 1


The documentation isn't clear about the ordering of the scores. When the documentation doesn't guarantee any kind of order, guarantee it yourself.

I suggest you simply iterate through the list, keeping track of the largest (for O(N) time).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .