In my app some Google APIs are optional. (In this case the Games API.)
In my settings activity, the user can choose to not signin into Google Games. There I call
Games.signOut(mGoogleApiClient);
googleApiClient.disconnect();
googleApiClient = createGoogleApiClientWithoutGames();
googleApiClient.connect();
createGoogleApiClientWithoutGames
method creates a new GoogleApiClient that does not use the Games API and corresponding scopes.
Is this the correct way to remove api and scope from the client?
How can I make sure that the googleApiClient of other activities (that are not yet destroyed) don't use the Games API? Currently, when returning from the settings activity, the client is connecting in
onStart()
using the current client configuration (with Games). Send a local broadcast message and recreate the client as well?