In my application I need to know when device is locked (on HTC\'s it looks like short press on \"power\" button). So the question is: which event is triggered when device is
There is a better way:
KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); if( myKM.inKeyguardRestrictedInputMode()) { //it is locked } else { //it is not locked }