Android Question Detect hardwarebutton from service

Nickelgrass

Active Member
Licensed User
Longtime User
Hi,
I would like to create a service (broadcast receiver?) running in the background that can detect a press on one of the hardwarebuttons without an activity being shown. Perhaps also with press and longpress determination. Is this possible? I would like to directly do things like launch another app by longpressing one of the hardware buttons.
Thanks!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…