I'm working on a game and on Game Over screen I need to execute a code from onSignInSucceeded() method.
About onSignInSucceeded() method from Google Developers website:
...If your game activity is inherited from the BaseGameActivity class, the system initiates the user sign-in flow automatically when your game launches. If the user has not previously signed-in, the system displays the sign-in dialog to prompt users to submit their credentials and calls the onSignInSucceeded() method upon a successful sign-in...
Code from onSignInSucceeded() method is always executed when I turn screen off and then turn it on, or when I hold menu button to see Recent Apps and then select game from Recent Apps list.
I'm not sure what exactly happens in game, but onSignInSucceeded() method is always executed after I do one of this things, although Game.java (Game Over screen is inside Game.java) does not extend BaseGameActivity class directly (I can't access any of methods from BaseGameActivity class in Game.java). Game.java does not extend Activity.
Is there a way to programmatically turn screen off and on from Game.java, or anything else that would have the same effect, so that onSignInSucceeded() method will be executed?
0 comments:
Post a Comment