I have a bluetooth headset which is able to communicate with my phone. It has one large 'call' button which answers/ends calls.
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>
but the call button does not appear to be classified as a media_button
any ideas on how I can achieve this? I would just like to know when the call button is pressed
try
http://developer.android.com/reference/android/content/Intent.html#ACTION_CALL_BUTTON
I'm not sure about it.. I think it fires for all call buttons, including any physical call buttons on the phone and buttons on the headsets .etc.
If the button is currently bringing up the Voice Dialer (mine does), you want ACTION_VOICE_COMMAND. Add the following to your intent filter: