In my game app I would like the user to sign in to Google Play Services during the starting activity so I had it subclass BaseGameActivity
. Then a separate activity is started for the game, at the end of which I want to update a leaderboard using Google Play Services, which requires calling BaseGameActivity.getApiClient()
.
How should I use Google Play services from a different activity than the one that subclasses BaseGameActivity
?
Two options I thought of were: pass a reference to the starting activity, or use a handler and send a message to the starting activity. But I don't know which would method would be better to use (or if a third way is better) and it seems like this might be a fairly common situation.