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.
アクティビティを開始するためにサービスを使用してハードキーが押されたことを傍受する方法はありますか?
言い換えると、サービスでKeyEventsを処理することは可能ですか?
はい。InputMethodServiceを使用してKeyEventsをキャプチャできます。ハードキーには、ソフトキーと同じように独自のキーコードがあります。
グーグルが作ったSoftKeypadの例を見てください。