Android 如何从Google play Games排行榜获得玩家排名

Android 如何从Google play Games排行榜获得玩家排名,android,google-play-services,google-play-games,leaderboard,google-play-services-3.3.0,Android,Google Play Services,Google Play Games,Leaderboard,Google Play Services 3.3.0,我曾经使用下面的方法从google play games排行榜获得玩家排名。现在google play服务库得到了更新。我不知道如何获得当前玩家的排名。请帮忙 private void accessGooglePlayRank() { Log.i("AndroidLauncher", "Rank : accessGooglePlayRank"); Games.Leaderboards.loadCurrentPlayerLeaderboardScore(gameHelper.g

我曾经使用下面的方法从google play games排行榜获得玩家排名。现在google play服务库得到了更新。我不知道如何获得当前玩家的排名。请帮忙

private void accessGooglePlayRank() { 

    Log.i("AndroidLauncher", "Rank : accessGooglePlayRank");
    Games.Leaderboards.loadCurrentPlayerLeaderboardScore(gameHelper.getApiClient(),
            leaderBoardID,
            LeaderboardVariant.TIME_SPAN_ALL_TIME,
            LeaderboardVariant.COLLECTION_PUBLIC).setResultCallback(new ResultCallback<Leaderboards.LoadPlayerScoreResult>() {
        @Override
        public void onResult(Leaderboards.LoadPlayerScoreResult loadPlayerScoreResult) {
            if (loadPlayerScoreResult != null && loadPlayerScoreResult.getScore() != null) {
                globalRank = loadPlayerScoreResult.getScore().getDisplayRank();
                gotRank=true;
            }
        }

    }); 



}
private void accessGooglePlayRank(){
Log.i(“AndroidLauncher”,“排名:accessGooglePlayRank”);
游戏.排行榜.LoadCurrentPlayerLeadboardScore(gameHelper.getApiClient(),
排行榜编号,
排行榜Variant.TIME\u SPAN\u ALL\u TIME,
LeadboardVariant.COLLECTION\u PUBLIC).setResultCallback(新ResultCallback(){
@凌驾
public void onResult(排行榜。LoadPlayerCoreResult LoadPlayerCoreResult){
if(LoadPlayerCoreResult!=null&&LoadPlayerCoreResult.getScore()!=null){
globalRank=LoadPlayerCoreResult.getScore().getDisplayRank();
gotRank=true;
}
}
}); 
}