principal-ideal-domain
principal-ideal-domain

Reputation: 4266

Google Play Game Services and BaseGameActivity questions

I've got a few questions concerning the Google Play Game Services and the BaseGameActivity class. In the Developer's Guide it is suggested that the main activity extends BaseGameActivity. On the next page I read that the system initiates the user sign-in flow automatically when the game launches when the main activity extends BaseGameActivity. But I don't want to force my users to use the Google Play Game Services. Only those who are keen on sharing there results with their friends should use this possibility. It this still possible with the BaseGameActivity class? So I just want to have a sign-in button (which is also described there) and no auto login at the start of the game.

Furthermore I want to know how to deal the following issue: In my game the results which should be submitted to Google are available in a different activity than the main activity. There I can't call getApiClient(). How am I supposed to treat such a situation?

Upvotes: 0

Views: 345

Answers (1)

apamuc
apamuc

Reputation: 21

Change this line in GameHelper.java

boolean mConnectOnStart = true;

to

boolean mConnectOnStart = false;

About getApiClient() just override the following method and make it public:

@Override
public GoogleApiClient getApiClient() {
    // TODO Auto-generated method stub
    return super.getApiClient();
}

If you do not have reference of your main activity you can pass it to some publis singleton class at beggin as a parameter and then access it later.

Upvotes: 2

Related Questions