1

I have a problem a few days now and I can not find a solution.

I am migrating an old Game I have made to the new Google play game.

I encounter the following problem:

When I call:

startActivityForResult(Games.Leaderboards.getAllLeaderboardsIntent(mGoogleApiClient), REQUEST_LEADERBOARDS);

The Activity suddenly closes and the the game returns to my Main Activity.

The weird is that this problem happens ONLY after I submitScore with the following code line:

if(longMyTopScore<45001) {Games.Leaderboards.submitScore(mGoogleApiClient, getResources().getString(R.string.leaderboard_higher_total_scores), longMyTopScore);}

I have read here that i had to clear cache and data from Google Play game service here. I did that and then it was again ok until i submitScore. Then the problem is here again.

I tried to handle that from startActivityForResult and I see that there is a resultCode 10001 (RESULT_RECONNECT_REQUIRED).

I dont know what to do. Please help!

Community
  • 1
  • 1
N.K.
  • 415
  • 3
  • 20

1 Answers1

0

Try to change from

startActivityForResult(Games.Leaderboards.getAllLeaderboardsIntent(mGoogleApiClient), REQUEST_LEADERBOARDS);

to

startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mGoogleApiClient,
LEADERBOARD_ID), REQUEST_LEADERBOARD);

Use getLeaderboardIntent instead of getAllLeaderboardsIntent as instructed in the Displaying a leaderboard tutorial in Google Play games.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56