Following the deprecation of the Google Sign-In API, we are removing the games v1 SDK in 2026. After February 2025, you will be unable to publish titles that are newly integrated with games v1 SDK, on Google Play. We recommend that you use the games v2 SDK instead.
While existing titles with the previous games v1 integrations continue to function for a couple of years, you are encouraged to migrate to v2 starting June 2025.
LeaderboardsClient.LeaderboardScores
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface
com.google.android.gms.common.api.Releasable
Public Methods
public Leaderboard
getLeaderboard ()
Returns
- The leaderboard that the requested scores belong to. This may be null if the
leaderboard metadata could not be found.
Returns
- The leaderboard scores that were requested. This is guaranteed to be non-null,
though it may be empty. The listener must close this object when finished.
public void release ()
Release the
LeaderboardScoreBuffer
used for scores storage.
Note that using LeaderboardScoreBuffer
after calling this method will
result in an error.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-24 UTC.
[null,null,["Last updated 2025-01-24 UTC."],[[["`LeaderboardsClient.LeaderboardScores` provides access to leaderboard scores and associated metadata."],["It's crucial to call `release()` on the `LeaderboardScores` object or the result of `getScores()` to free up resources."],["`getLeaderboard()` returns the leaderboard associated with the scores, while `getScores()` provides access to the actual leaderboard scores."],["Developers must ensure `LeaderboardScoreBuffer` is released to avoid errors after its use."]]],["`LeaderboardsClient.LeaderboardScores` delivers results after loading leaderboard scores. It requires `release()` to be called on itself or the `LeaderboardScoreBuffer` from `getScores()` when finished. Key actions are using `getLeaderboard()` to retrieve the associated leaderboard and `getScores()` to obtain the requested scores. The `release()` method frees the `LeaderboardScoreBuffer`. Inherited methods are also available for various object-related operations.\n"]]