How to capture key events from bluetooth headset with android

前端 未结 3 1575
夕颜
夕颜 2020-12-01 01:42

My app can be controlled by normal headset. It simply overrides \"onKeyDown\". But key events from bluetooth headset are not captured - why? Or how to capture bluetooth key

3条回答
  •  [愿得一人]
    2020-12-01 02:15

    Check out this article. It explains how to implement something similar using media button actions.

    I know you've mentioned that you walked this way without success, still give it a try. Point your attention to gotchas related to registering broadcast receiver, setting intent filter priorities and adding permissions (all explained in the article).

    Hope this will help.

提交回复
热议问题