检测蓝牙“呼叫”按钮preSS [英] Detecting bluetooth 'call' button press
问题描述
我有一个蓝牙耳机,它能够与我的电话沟通。它有一个大的呼叫按钮,接听/结束通话。
I have a bluetooth headset which is able to communicate with my phone. It has one large 'call' button which answers/ends calls.
我试图让一个应用程序将能够拦截时调用按钮pssed $ P $。我一直在使用一个意图过滤器的尝试:
I am trying to make an app which will be able to intercept when the call button is pressed. I have tried using an intent filter:
<receiver android:name=".MediaButtonIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
但呼叫按钮没有出现被归类为一个media_button
but the call button does not appear to be classified as a media_button
我如何能做到这一点任何想法?我只是想知道什么时候该呼叫按钮是pssed $ P $
any ideas on how I can achieve this? I would just like to know when the call button is pressed
推荐答案
如果该按钮当前造就了语音拨号(我的),将你想要的 ACTION_VOICE_COMMAND 。以下添加到您的意图过滤器:
If the button is currently bringing up the Voice Dialer (mine does), you want ACTION_VOICE_COMMAND. Add the following to your intent filter:
<action android:name="android.intent.action.VOICE_COMMAND" />
<category android:name="android.intent.category.DEFAULT" />
这篇关于检测蓝牙“呼叫”按钮preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!