0

On Appcelerator Android, is there a way to detect when the user click on the power button to switch off the screen while on the app, and detect when the user switch on the screen while the app is on screen ? I am unable to find an event in the Appcelerator doc, and any module that does that.

Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28
Guile
  • 1,473
  • 1
  • 12
  • 20

1 Answers1

0

There's no way in Titanium core APIs to detect this specific event. You can add a callback to the current activity's onPause callback or the current Window's blur event but those will be called/fired in many situations.

You could write a module to detect the keypress: https://stackoverflow.com/a/8668648/4626813

Community
  • 1
  • 1
Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28