In my gaming application, I would like the user to log into the Google Play service during the initial activity, so I had a subclass of BaseGameActivity . Then, for the game, a separate action begins, at the end of which I want to update the leaderboard using Google Play Services, for which I need to call BaseGameActivity.getApiClient() .
How do I use Google Play services from another action, except that subclasses BaseGameActivity ?
Two options that I was thinking about are: pass a link to the initial activity or use a handler and send a message to the initial operation. But I donβt know which method is better to use (or if the third method is better), and it looks like this might be a fairly common situation.
source share