Skip to main content
Known Participant
April 27, 2013
Answered

Sleep mode Android still running

  • April 27, 2013
  • 2 replies
  • 777 views

Dear developers, I have a small problem with a game I am developing for Android/IOS.  I am testing it out on a Samsumg Galaxy Tab II 10.1 and have the following behaviour.

When I press the power button to enter sleep mode with the app playing, after the screen goes black I can continue to hear game sounds from the tablet (even 30 seconds after pressing the power button).  When I turn it back on, it is clear that the game play has moved forward (at a lower frame rate, as the link below suggests).  Is this expected behaviour?

http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-8000.html

My question is "What line of code do I use to detect when the screen goes black?"  When I receive this trigger I would then force the game to go into a pause mode (which I have already coded for anyways).

Thank you

This topic has been closed for replies.
Correct answer nimitja

Hi,

Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.

Regards,

Nimit

2 replies

nimitjaCorrect answer
Adobe Employee
April 27, 2013

Hi,

Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.

Regards,

Nimit

Known Participant
April 27, 2013

Many thanks, it worked perfectly.

Justin