How can I checked if play/pause button in my headset is clicked?
After that can I implement some method that could change typical action (play/pause) for my own action (shut down etc.) ?
How can I checked if play/pause button in my headset is clicked? After that
Share
If you are trying to listen for this from an activity in the foreground, use
onKeyDown()and watch forKEYCODE_MEDIA_PLAY_PAUSE.Use a
BroadcastReceiverforACTION_MEDIA_BUTTONif you are trying to listen for this event from the background (e.g., a service playing music).