Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Androidで有線ヘッドセット(Bluetoothヘッドセットなし、非常に重要)ボタンを処理することは可能ですか? たとえば、ユーザーが「再生」ボタンを押すと (着信を受信)、TextView のテキストを変更します (これはダミーの例であり、実際のミッションではありません :))。
誰かがコード例を投稿できますか? (可能であれば)
ありがとう、IB
で上書きし、 のファミリを監視onKeyDown()します。ActivityKEYCODE_MEDIA_*KeyEvents
onKeyDown()
Activity
KEYCODE_MEDIA_*
KeyEvents