Currently we open Achievements View with
startActivityForResult(mHelper.getGamesClient().getAchievementsIntent(), REQUEST_ACHIEVEMENTS);
Can we get some kind of callback when achievements view was closed? Or if it is possible - to get a callback when user Exits GPG within the achievements view. GameHelper's "onDisconnected()" is not firing for some reason - when that happens. I've googled this - but found nothing
Edit: should i look for some specific responseCode inside onActivityResult ?
Declare this variable and this method in your class.
private static int achievementsIntent = 10001;
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == achievementsIntent) {
//you are in your callback
if (resultCode == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
// user logged out from achievements screen
}
}
}
Then call your achievements intent:
startActivityForResult(Games.Achievements.getAchievementsIntent(GoogleApiClient), achievementsIntent);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.