开发者

Android Headset buttons

开发者 https://www.devze.com 2023-03-27 06:37 出处:网络
My HTC headset has 3 buttons. Next/Pause/Previous. I can emulate the pause button in my code by call开发者_运维百科ing ACTION_MEDIA_BUTTON.

My HTC headset has 3 buttons. Next/Pause/Previous.

I can emulate the pause button in my code by call开发者_运维百科ing ACTION_MEDIA_BUTTON.

How can i emulate The Next and the Previous button?

Thanks!


Use ACTION_MEDIA_BUTTON. There is an EXTRA_KEY_EVENT that holds a KeyEvent tied to which specific media button was pressed. KEYCODE_MEDIA_NEXT and KEYCODE_MEDIA_PREVIOUS are likely candidates to map to your particular buttons, but you may have to experiment.

0

精彩评论

暂无评论...
验证码 换一张
取 消