I am currently using the GameSharing class to submit scores and achievements to the Google Play Games Service.
The score is tracking well and even the achievement ui popup is displayed correctly (which shows the progress for all achievements), however popups are not being shown when the player unlocks an individual achievement. I can confirm that the methods are being called and that the lines of code in question are being executed. Any idea of what the problem could be?
static public void updateAchievement(int percentage){
if(gpgAvailable){
Games.Achievements.unlock(((AppActivity)currentContext).getGameHelper().getApiClient(), achievementIDs[currentAchievementID]);
}
}
Problem seems to have been solved after having enclosed the unlock achievement code in a UI thread.
static public void updateAchievement(int percentage){
if(gpgAvailable){
((AppActivity)currentContext).runOnUiThread(new Runnable() {
public void run() {
Games.Achievements.unlock(((AppActivity)currentContext).getGameHelper().getApiClient(), achievementIDs[currentAchievementID]);
}
});
}
}