05-02-2011 04:08 AM
Good Morning.
I'm developing a game for bb 9000 (4.6.0) and I would like to stop the game when the user switches to another application (e.g. pressing the red button or answering to a phone call)
I'm using threads to make the game working and there are some static variables I use to test if stop or not the game.
For example, if I press "p" I can pause the game.
But... I can't find the way to put in pause the game if a call is arriving or if the user presses the red button.
Generally if there is an event that put in background the application, I'd like to pause the game.
Do you know how to help me?
Thanks in advance
Solved! Go to Solution.
05-02-2011 04:37 AM
You can check following methods
Screen.onObscured() Screen.onUiEngineAttached(boolean) Field.onVisibilityChange(boolean)
It is up to you which one is most appropriate for your app, you can place a code to pause the game inside the method you choose
05-02-2011 10:53 AM