I thought this would be straightforward, but I've been going in circles trying to figure out how to keep a user logged in between Activities
.
I have a "Main" and a "Details" Activity
. A user logs into Google Play Services
in the "Main" Activity
and I want to submit achievements and leaderboard data in the "Details" Activity
.
I'm inheriting from BaseGameActivity
in both Activities
and using:
mGoogleApiClient = getApiClient();
in "Details", however when I call isConnected
it always returns false
.
I even tried copying all the login/callback code from the "Main" Activity
over, but it's still doesn't detect the user is logged in.
This post suggests not using BaseGameActivity
and pass GameHelper
using a singleton
:
How to use BaseGameActivity.getApiClient() in multiple activities?
Not sure what the correct approach is.