Here is how I did it:
static final int[] statusesToLoad = new int[]{
TurnBasedMatch.MATCH_TURN_STATUS_INVITED,
TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN,
TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN,
TurnBasedMatch.MATCH_TURN_STATUS_COMPLETE};
PendingResult<TurnBasedMultiplayer.LoadMatchesResult> loadMathesResult = Games.TurnBasedMultiplayer.loadMatchesByStatus(mGoogleApiClient, statusesToLoad);
loadMathesResult.setResultCallback(new loadMatchesCallback());
And then in the callback you can get data buffers for all active games in which you participate, and all the invitations you received:
private class loadMatchesCallback implements ResultCallback<TurnBasedMultiplayer.LoadMatchesResult>{
@Override
public void onResult(TurnBasedMultiplayer.LoadMatchesResult loadMatchesResult) {
LoadMatchesResponse response = loadMatchesResult.getMatches();
TurnBasedMatchBuffer myTurnMatches = response.getMyTurnMatches();
TurnBasedMatchBuffer theirTurnMatches = response.getTheirTurnMatches();
TurnBasedMatchBuffer completedMatches = response.getCompletedMatches();
InvitationBuffer invitations = response.getInvitations();
}
}
}
, ArrayList, , Google , release() . , .