Android 中是否可以检测 Whatsapp 语音通话结束?
当WhatsApp语音呼叫结束时,我想听。
如果授予该应用程序访问通知侦听器,我可以通过解析通知数据来检测传入的WhatsApp调用,但是当呼叫结束时没有数据。
那么有任何解决方案吗?谢谢。
I would like to listen when Whatsapp voice call ended.
If the app was granted to access notification listener, I can detect an incoming WhatsApp call by parsing notification data but there are no data when a call ended.
So is there any solutions for this case? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还可以检测到呼叫是否正在进行...因为通知每秒都会发布给听众(因为通知持续时间信息更改了
每秒)直到通话结束。只需启动一个计时器过程即可检测到上次检测到WhatsApp调用通知,如果时间大于3秒钟,您可以将其声明为呼叫的结尾并在此处运行代码。
You can also detect if the call is ongoing... because the notification will be posted to the listener every second ( Because the call duration info in notification changes
every second ) until the call ends. Just start a timer process to detect the last time a WhatsApp call notification was detected , and if the time is greater than 3 seconds, you can declare that as an ending of a call and run your code there.