I am currently trying to listen for when the power button is pressed. Ultimately I would like to have some code run when the power button is pressed twice, to check whether
I've used android-annotations "@Receiver" annotation.
Add this to your "@EActivity" annotated Activity:
@Receiver(actions = Intent.ACTION_SCREEN_OFF) protected void onPowerButtonPressed() { // add your code }