我试过这段代码
Games.Players.loadMoreRecentlyPlayedWithPlayers(
mGoogleApiClient, 20);
但我不确定如何使用它。
答案 0 :(得分:0)
我得到了我的答案,我可以取我最近的游戏玩家。
PendingResult<Players.LoadPlayersResult> loadplayers = Games.Players
.loadMoreRecentlyPlayedWithPlayers(mGoogleApiClient, 20);
loadplayers.setResultCallback(new ResultCallback<Players.LoadPlayersResult>() {
@Override
public void onResult(LoadPlayersResult loadplayersResult) {
if (loadplayersResult != null) {
if (loadplayersResult.getStatus().getStatusCode() == GamesStatusCodes.STATUS_OK) {
if (loadplayersResult.getPlayers() != null) {
PlayerBuffer plyersBufr = loadplayersResult.getPlayers();
for (Player p : plyersBufr) {
Log.d(TAG, p.getDisplayName() + " " + p.getTitle()+" "
+ p.getLastPlayedWithTimestamp() + " " + p.getLevelInfo());
}
}
}
}
}
});
无论如何,谢谢:)