I am trying to detect key presses of the Bluetooth headset. Overriding onKeyDown and dispatchKeyEvent methods can detect normal headphones presses but not the Bluetooth ones. The other questions related to this topic are from ages ago, so they are not useful because of deprecated methods, etc.
Asked
Active
Viewed 140 times
0
-
Are you a media app that is currently playing something? – ianhanniballake Dec 07 '21 at 05:04
-
actually yes, I use MediaPlayer class to play audio and want to react to the Bluetooth key presses @ianhanniballake – bugra Dec 07 '21 at 06:31
-
Did you [read the documentation](https://developer.android.com/guide/topics/media-apps/mediabuttons)? – ianhanniballake Dec 07 '21 at 06:46
-
Yes, I did. Documentation recommends using FLAG_HANDLES_MEDIA_BUTTONS which is deprecated. @ianhanniballake – bugra Dec 07 '21 at 15:51