如何检测机器人来电状态 [英] How to detect incoming call status in android

查看:193
本文介绍了如何检测机器人来电状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法,使我们可以发现像机器人来电的状态 TelephonyManager.CALL_STATE_RINGING CALL_STATE_IDLE 。结果
如果接听来电那么什么是其在电话管理器API结果状态
如果来电未接未回答那么什么是其在电话管理器API的状态。结果
任何一个可以帮助我关于这个问题的。
结果
由于提前

Is there any way in which we can detect status of incoming call in android like TelephonyManager.CALL_STATE_RINGING or CALL_STATE_IDLE.
If the incoming call is answered then what is its status in TELEPHONY MANAGER API
If the incoming call is missed that is not answered then what is its status in TELEPHONY MANAGER API.
Can any one help me regarding this issue.
Thanks in Advance

推荐答案

当有来电时需要创建的 广播接收器 处理的 ACTION_ANSWER 意图。

To get the state when a call comes in need to create a BroadcastReceiver to handle the ACTION_ANSWER intent.

您还可以添加广播接收器的<一个href=\"http://developer.android.com/reference/android/telephony/TelephonyManager.html#ACTION_PHONE_STATE_CHANGED\"相对=nofollow> ACTION_PHONE_STATE_CHANGED ,然后眼睁睁的看着 TelephonyManager 通话状态的变化。我不能完全肯定的通话过程中,或者如果错过了呼叫状态的行为,但你可以很快pretty它使用广播接收器试验。

You can also add a BroadcastReceiver for the ACTION_PHONE_STATE_CHANGED and watch as the TelephonyManager Call State changes. I'm not entirely sure the behavior of the call status during the call or if missed, but you can pretty quickly experiment with it using BroadcastReceiver.

不要忘记注册您的接收器的Andr​​oidManifest.xml

Don't forget to register the receivers in your AndroidManifest.xml.

这篇关于如何检测机器人来电状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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