问题描述
有没有什么办法,使我们可以发现像机器人来电的状态 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
推荐答案
当有来电时需要创建的处理的意图。
To get the state when a call comes in need to create a BroadcastReceiver
to handle the ACTION_ANSWER
intent.
您还可以添加广播接收器
的 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
.
不要忘记注册您的接收器的AndroidManifest.xml
。
Don't forget to register the receivers in your AndroidManifest.xml
.
这篇关于如何检测机器人来电状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!