For now, I just want to display the pressed button! when I press any button (volume or call button) on the paired Bluetooth headset (LG HBM-770). I tried the exact method here (this is the code I'm using): Android - registering the headset button with BroadcastReceiver without any luck, including the proposed fixes, Google search clock only indicates this type of code. Bluetooth permission is allowed in the manifest.
If I press the call button right now, it seems to never get into my application, instead a menu appears asking you to choose which application will process (voice search, Google voice, etc.). If I hold the Bluetooth call button, my phone calls the last number dialed. If I try to replace the Intent filter type with ACTION_POWER_DISCONNECTED, it works flawlessly when I turn off the power, so it seems that the code from this point is working fine.
It would be nice if I didn’t use any filter at all, and Toast simply appeared, displaying the identifier of ANY action received, so I know how the buttons on the phone look exactly.
source share