I use Google Game Services for leaders. Showing it like this:
static public void showLeaderboard(String lid)
{
if (isLogined() == 1)
{
Log.i(TAG, "Showing leaderboard...");
Intent intent = Games.Leaderboards.getLeaderboardIntent(mClient, lid);
mApp.startActivityForResult(intent, 1);
}
}
static public int isLogined()
{
if (mClient != null && mClient.isConnected())
return 1;
return 0;
}
But when I open the leaderboards and exit the Google Game Services using the Google user interface (menu icon "Overflow" → "Settings" → "Exit"), I save my isLogined () == 1. So, when I call showLeaderboard ( ) the second time - the game crashes with the exception of:
java.lang.SecurityException: Not signed in when calling API
GoogleApiClient has callbacks to connect, but not to disconnect. How can I handle singing from GGS using the Google UI?
source
share