Android以编程方式从谷歌播放服务获取排行榜名称(Android get leaderboard name from google play services programatically)

我看到了这个https://developers.google.com/android/reference/com/google/android/gms/games/leaderboard/Leaderboard和:getDisplayName()检索此排行榜的显示名称。

如何使用排行榜ID“获取”排行榜来调用此方法? 在某个地方有这样的例子吗? 谢谢。

I see this https://developers.google.com/android/reference/com/google/android/gms/games/leaderboard/Leaderboard and: getDisplayName() Retrieves the display name of this leaderboard.

How do I "get" the leaderboard using the leaderboard id to call this method? Is there an example of this somewhere? Thanks.

最满意答案

文档中的排行榜参考仅指出getDisplayName()作为检索排行榜显示名称的方法。 它没有提到使用排行榜ID的内置函数。

本教程中提供了一个示例用法:

Leaderboard leaderboard = loadScoresResult .getLeaderboard(); String leaderboardName = leaderboard.getDisplayName() ;

The Leaderboard reference in the docs only state getDisplayName () as a means to retrieve the display name of the leaderboard. It does not mention a built-in function using the leaderboard id.

A sample usage of this is found in this tutorial:

Leaderboard leaderboard = loadScoresResult .getLeaderboard(); String leaderboardName = leaderboard.getDisplayName() ;

更多推荐