title: Detect on/off Key Press Android
body: <p>How can I detect the power button or lock screen button being pressed? When my game is paused in this way, it can cause the game to crash because I need to pause a thread when it happens.</p>