Remap Bluetooth Headset's media key [Android 9]
I solved my issue by using a app called AutoVoice in combination with Tasker.

In Android Settings, Apps, Default Apps, Assist &amp; Voice Input I selected AutoVoice.

In Tasker I created a Profile which is a Event triggered by Plugins &gt; AutoVoice &gt; AutoVoice BT Pressed and the connected Task contains only Media Control, Switch Pause, Simulate Media Key is activated and I selected a music app as App, in my case Spotify.

This works just fine.

Let me know if you have the same problem and have issues with my solution.