android - How to intercept a hard key pressed in a service? -
Was a hard key pressed by using a service to launch any activity?
In other words: Is it possible to handle the main agencies in the service?
Nobody is listening to the key events of the hardware keys than currently active application The normal way of
Only camera button events can be detected through its broadcast intent
.
When the CAMERA button is pressed and it does not stop, ACTION_CAMERA_BUTTON is broadcasting foreground activity:
This means that you can only locate the press if the application in the foreground The key is not controlling the press.
Comments
Post a Comment