title: How to detect key events in service and broadcast receiver
body: <p>How can I get key events when a user presses various buttons in a service or broadcast receiver? I'm specifically interested in knowing when the user presses a volume button so that I can trigger something else in the background, like a voice recorder.</p>
  
  <p>Unfortunately, my internet searches haven't produced any results.</p>