从 EndCall 事件接收回调
我正在开发的应用程序需要知道何时有人按下“结束通话”按钮。它根本不需要改变按钮的功能。它只需要知道何时按下即可。我只是想知道这是否可能以及如何做到这一点?
我一直在研究 KeyEvent 类,但无法实现它。我什至不知道它是否会起作用。
The app I am developing needs to know when someone presses the End Call button. It doesn't need to alter the button's function at all. It merely needs to know when it is pressed. I would just like to know if this is possible and how to do this?
I have been looking at the KeyEvent class, but I am unable to implement it. I don't even know if it will work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我高度怀疑你可以做到这一点......捕获密钥不在您的应用程序中的事件只是恶意代码。
也许您有兴趣知道呼叫是否已终止?
如果是这样:使用
PhoneStateListener
到 检测来自CALL_STATE_RINGING/CALL_STATE_OFFHOOK
至CALL_STATE_IDLE
I highly doubt you can do this ... trapping key events that are not in your application is just malicious code.
Maybe you are interested in knowing if a call has been terminated?
If so: use the
PhoneStateListener
to detect state transitions fromCALL_STATE_RINGING/CALL_STATE_OFFHOOK
toCALL_STATE_IDLE