> My application runs in background and needs to detect when the user > presses and holds a button (for 3-4 seconds) on the phone even when > the phones key lock is on.
Sorry, that is not possible. > I am in the process of learning Android programming but so far what I > understand is that if my application runs as a service it would be > able to receive broadcast such as ACTION_MEDIA_BUTTON. Am I looking in > the right direction? Yes, but that is for a button press, not a press-and-hold. > I had a quick look at the list of native android broadcast actions and > I could only find broadcast actions for Camera, Media and Call > buttons. What about the other buttons? The only *broadcast* Intents based on a button are ACTION_MEDIA_BUTTON and ACTION_CAMERA_BUTTON. No other keys have broadcast Intents AFAIK. The call button Intent is an activity action, not a broadcast action. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- 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

