开发者

Global control handler

开发者 https://www.devze.com 2023-01-19 20:30 出处:网络
I have an Android service that runs in background. I need it to recieve feedback (and stop, for example) just 开发者_如何学Cwhen user did something, no matter if it\'s only touch event on homescreen o

I have an Android service that runs in background. I need it to recieve feedback (and stop, for example) just 开发者_如何学Cwhen user did something, no matter if it's only touch event on homescreen of somewhere else or key press.

Is it possible to handle global touch and key events?


While I highly doubt that there is an easy way to do this, you can register intents and intercept the messages for your own purpose. Have a look at the intent library for specific intents that you might hijack for your application. You may find further information in the android documentation on intent filters.

0

精彩评论

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