是否可以在Android中检测被拒绝的呼叫? [英] Is it possible to detect rejected calls in Android?
问题描述
在我的应用程序中,当用户拒绝呼叫(即选择发送忙音)时进行拦截会很好。
除了有来电通知时,还有什么方法可以做到这一点?
我没有在文档中找到与此相关的任何内容。
此信息是否存储在呼叫日志中,即我可以查询呼叫日志以查看呼叫是否被拒绝或应答?
嘿。
您可以使用 PhoneStateListener
和 CallLog
类查询最近的通话列表以查找被拒绝的通话。 / p>
http://developer.android.com/ reference / android / provider / CallLog.html
http://developer.android .com / reference / android / telephony / PhoneStateListener.html
您也可以在 android.intent.action.NEW_OUTGOING_CALL上监视广播
和 android.intent.action.NEW_INCOMING_CALL
只是 android.permission.PROCESS_INCOMING_CALLS
和 android.permission.PROCESS_OUTGOING_CALLS
在您的清单中。
In my application, it would be nice to intercept when the user rejects a call, i.e. choose to send busy tone. Is there any way, besides being notified when there is an incoming call, to do this? I have not found anything in the docs regarding this. Is this information stored in the call log, i.e. can I poll the call log to see if a call was rejected or answered?
Hey.
You could use the PhoneStateListener
and CallLog
classes to query the recent calls list to find rejected calls.
http://developer.android.com/reference/android/provider/CallLog.html http://developer.android.com/reference/android/telephony/PhoneStateListener.html
Alternatively you can monitor broadcasts on android.intent.action.NEW_OUTGOING_CALL
and android.intent.action.NEW_INCOMING_CALL
just put android.permission.PROCESS_INCOMING_CALLS
and android.permission.PROCESS_OUTGOING_CALLS
in your manifest.
这篇关于是否可以在Android中检测被拒绝的呼叫?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!