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

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -