i try to get bluetooth button key press with the popular code from the web. also in this thread Capture media button on Android >=4.0 (works on 2.3)
but google now responds to it (although my app is in foreground) cannot achieve this. what i did: (env nexus 4, android 4.4.4)
turn off google now setting preferences 'bluetooth headset recording' (not sure the exact name cause i'm not using it in english - looks like a bug - it is off and still google search is responding
turn off google now at all - i think it is another bug - it is off and still responds to to my BlueTooth button.
in my app:
have correct BT permission
in manifest file - register recevier by:
or previous in other way in my app onCreate() method: mediaButton = new MediaButtonIntentReceiver();
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY-1); registerReceiver(mediaButton, intentFilter);
or this ((AudioManager)getSystemService(AUDIO_SERVICE)).registerMediaButtonEventReceiver(new ComponentName(this, MediaButtonIntentReceiver.class));
any suggestions? please help.