检测拨出电话,使用真实设备发出问题
我有一个奇怪的问题。为了检测拨出电话,我为 android.intent.action.PHONE_STATE
注册了一个广播接收器。当状态变为摘机时,则开始通话。它似乎在模拟器上工作:调试器实际上达到了一些代码,但它在真实设备(Acer Liquid)上不起作用。可能吗?
哪种方法可以检测拨出电话?
I have a strange problem. To detect outgoing calls I have registered a broadcast receiver for android.intent.action.PHONE_STATE
. When the state becomes OFFHOOK, then a conversation is started. It seems working on emulator: the debugger in fact reaches some code while it doesn't work on real device (Acer Liquid). Is it possible?
Which is a way to detect outgoing calls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,如果它可以在模拟器上运行,我希望它可以在设备上运行。您可以通过
listen()
向TelephonyManager
注册PhoneStateListener
并查看它是否会为您带来更好的结果。如果您想到了,请用您的测试结果对此答案进行评论。
Well, if it works on the emulator, I would expect it to work on the device. You might registering a
PhoneStateListener
with theTelephonyManager
vialisten()
and see if it gets you better results.If you think of it, comment on this answer with the results of your testing.