Skip to content

Commit 4a6f6cc

Browse files
committed
Only switch to main screen when the signed in account changes
use Multiplayer.EXTRA_INVITATION when retrieving an invitiation Addresses both issues in #264 Change-Id: I8c3c9673bccad6d05e056b8583eb3d8cb89452c6
1 parent 35d283f commit 4a6f6cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ButtonClicker/src/main/java/com/google/example/games/bc/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ public void onSuccess(Player player) {
639639
}
640640
}
641641
);
642+
643+
switchToMainScreen();
642644
}
643645

644646
// register listener so we are notified if we receive an invitation to play
@@ -654,7 +656,7 @@ public void onSuccess(Player player) {
654656
public void onSuccess(Bundle hint) {
655657
if (hint != null) {
656658
Invitation invitation =
657-
hint.getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
659+
hint.getParcelable(Multiplayer.EXTRA_INVITATION);
658660

659661
if (invitation != null && invitation.getInvitationId() != null) {
660662
// retrieve and cache the invitation ID
@@ -665,8 +667,6 @@ public void onSuccess(Bundle hint) {
665667
}
666668
})
667669
.addOnFailureListener(createFailureListener("There was a problem getting the activation hint!"));
668-
669-
switchToMainScreen();
670670
}
671671

672672
private OnFailureListener createFailureListener(final String string) {

0 commit comments

Comments
 (0)