检测拨出电话,使用真实设备发出问题

发布于 2024-08-29 13:39:18 字数 175 浏览 9 评论 0原文

我有一个奇怪的问题。为了检测拨出电话,我为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

就像说晚安 2024-09-05 13:39:19

好吧,如果它可以在模拟器上运行,我希望它可以在设备上运行。您可以通过 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 the TelephonyManager via listen() and see if it gets you better results.

If you think of it, comment on this answer with the results of your testing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文