开发者

Android Headset buttons

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜