我尝试了以下代码:
public void skorAl() {
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this)) .loadCurrentPlayerLeaderboardScore(getString(R.string.leaderboard_skor_tablosu),LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC)
.addOnSuccessListener(this,new OnSuccessListener<AnnotatedData<LeaderboardScore>>() {
@Override
public void onSuccess(AnnotatedData<LeaderboardScore> leaderboardScoreAnnotatedData) {
if (leaderboardScoreAnnotatedData != null) {
if (leaderboardScoreAnnotatedData.get() != null) {
longScore = leaderboardScoreAnnotatedData.get().getRawScore();
}
}
} });
}
我为longScore
得到了0。我不知道我在做什么错。我想获得当前的用户分数。我猜想GoogleSignIn.getLastSignedInAccount(this)
命令无法正常工作。