Android Question MEDIA_BUTTON with Android 7+ and API 26

Pendrush

Well-Known Member
Licensed User
Longtime User
Hi all,
I have tried every example on forum including all examples from:
https://www.b4x.com/android/forum/threads/android-intent-action-media_button-again.48890/#content
also tried to change manifest from example provided by google from:
https://developer.android.com/reference/android/support/v4/media/session/MediaButtonReceiver.html
Without success with BroadcastReceiver library.
I'm unable to fire event in service when media button on headphones is clicked.
Tested on two devices: Nexus 5 with LineageOS (Android 7.1.2) and Samsung Note 5 (Stock Android 7.0.0).
My app have minSdkVersion set to 21 and targetSdkVersion set to 26.

Can anyone provide some working example?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…