Android - How to prevent the phone screen from turning on when volume or camera key is pressed?
Posted
by 2Real
on Stack Overflow
See other posts from Stack Overflow
or by 2Real
Published on 2010-06-05T20:09:54Z
Indexed on
2010/06/05
20:12 UTC
Read the original article
Hit count: 192
I have an activity that shows up when the phone screen goes to sleep/turns off ie turns black. For some reason, the phone turns on when the volume buttons or the camera buttons are pressed. By turns on, I mean the screen wakes up or comes back from the black screen state.
I've tried using dispatchKeyEvent(KeyEvent event) and the buttons are disabled on the activity, but they still wake up the phone.
© Stack Overflow or respective owner