79594362

Date: 2025-04-26 20:14:43
Score: 1.5
Natty:
Report link

MediaSession is only supported for interacting with Audio and Video players not MediaRecorder, and onMediaButtonEvent callback will be triggered only when the MediaSession is registered and your app should have audio focus granted.

It seems you are trying control the audio recording with your bluetooth headset buttons, you should go with your second approch i.e generic BroadcastReceiver.

Documentation Link : https://developer.android.com/media/legacy/mediasession

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: nuclear_nadal