In your own activity, you can watch for KEYCODE_POWER in onKeyDown(), apparently:
http://stackoverflow.com/questions/3703071/how-to-hook-into-the-power-button-in-android Beyond that, I think you are out of luck. On Fri, Feb 11, 2011 at 9:32 PM, niko001 <[email protected]> wrote: > Hi, > > in reply to this discussion: > http://groups.google.com/group/android-developers/browse_thread/thread/491a9901f0cc58d6# > (which is too old to reply to): > > Is there any way to distinguish between "the user pressed the power > button" and "the screen timed out"? ACTION_SCREEN_OFF is sent in both > cases, but I need to single out the cases in which the user actively > pressed the power button. > > Thanks, > Nick > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.4 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

