I don't understand what you mean. Having one or many functions with a pending result is the same thing. The code that I posted above is generic. It is called by different functions, e.g.:
public PendingResultWrapper FinishMatch(String MatchId)
{
PendingResult<UpdateMatchResult> PR = _TBMP.finishMatch(GooglePlayConnection.getAPIclient(), MatchId);
return new PendingResultWrapper(PR, UpdateMatchResult.class);
}
...
public PendingResultWrapper TakeTurn(String MatchId, byte[] MatchData, String PendingParticipantId)
{
PendingResult<UpdateMatchResult> PR;
if (PendingParticipantId.length() == 0)
PR = _TBMP.takeTurn(GooglePlayConnection.getAPIclient(), MatchId, MatchData, null);
else
PR = _TBMP.takeTurn(GooglePlayConnection.getAPIclient(), MatchId, MatchData, PendingParticipantId);
return new PendingResultWrapper(PR, UpdateMatchResult.class);
}
In B4A, the user can specify the event of his choice for each function, so it can group events or have a different event for each function:
Dim PR As GPlayPendingResult = TBMulti.CreateMatch(Config)
PR.SetResultEvent(EventName)
It's an improvement over the previous system which had listeners common to many functions.
You have to write more code because you have to create a named class to wrap each result class (InitiateMatchResult, UpdateMatchResult, CancelMatchResult, etc.) but once you created one, the others are just copied/pasted and there's not a lot of different result classes.