开发者

overriding key combination on startup

开发者 https://www.devze.com 2023-03-12 11:27 出处:网络
Well I have an application that tests if there\'s a SIM change every time the phone boots and if it is, it starts a certain ser开发者_如何学运维vice. I want to override a certain combination of keys,

Well I have an application that tests if there's a SIM change every time the phone boots and if it is, it starts a certain ser开发者_如何学运维vice. I want to override a certain combination of keys, let's say for example the volume up key with the boot key, that if pressed together at the phone boot will stop the service even if the SIM is changed. How can I do it? Thx a lot


There is no "boot key".

For keys that exist, in your activity, you can listen for KeyEvents via onKeyDown(). However, you cannot listen for KeyEvents outside of one of your activities -- that would be a massive security hole.

0

精彩评论

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

关注公众号