Android Question Long press headset button

brelto85

Active Member
Licensed User
Longtime User
i'm trying to use BroadcastReceiver to register a long press of headset button

I've write this code in the Service_Start

B4X:
Sub Service_Start (StartingIntent AsIntent)
Broadcast.addAction("android.intent.action.MEDIA_BUTTON")
Broadcast.SetPriority(999)
Broadcast.registerReceiver("")End Sub

but it doesn't works when clicked (long press) headset button
starts always google search (Google Now)

How to make it work?

Alberto
 

brelto85

Active Member
Licensed User
Longtime User
doesn't work
looking for, i've found this comment into this link
"I'm afraid not. In Android 4.0+, all media button receivers have to use registerMediaButtonEventReceiverto receive button clicks. This part still works, but sadly doesn't make Android give the intent to third party apps before handling Voice Search"
 
Upvote 0
Top