听在后台服务的音量按钮? [英] Listen to volume buttons in background service?

查看:121
本文介绍了听在后台服务的音量按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何倾听音量按钮在活动。但我可以做,在后台服务?如果是的话,那怎么办?

I know how to listen to volume buttons in an activity. But can I do that in a background service? If yes, how to do that?

推荐答案

由几个有关此主题的其他问题来看,没有。

Judging by the couple of other questions about this topic, no.

<一个href="http://stackoverflow.com/questions/2986337/is-it-possible-to-create-an-android-service-that-listens-for-hardware-key-$p$psse">Other问题1 , 其他问题2

服务根本就没有收到KeyEvent的回调。

Services simply do not receive KeyEvent callbacks.

这篇关于听在后台服务的音量按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆