ACTION_NEW_OUTGOING_CALL
广播后,我需要捕捉对方应答的以下事件。您能否就如何实现这一目标提出建议?我知道这是可能的,因为 Android 拨号器应用程序会在他们接机时将绿色的 Android 图标更改为该人的照片。
更新:我查看了 Android 上处理拨出电话的应用程序的来源。我在 ContactsUtils
中注意到以下方法:
/**
* Kick off an intent to initiate a call.
*/
public static void initiateCall(Context context, CharSequence
phoneNumber) {
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", phoneNumber.toString(), null));
context.startActivity(intent); }
我想我的答案是在监听 Intent.ACTION_CALL_PRIVILEGED
的 Activity 中。所以改写我的问题:有谁知道哪个 Activity 处理 Intent.ACTION_CALL_PRIVILEGED
?
最佳答案
我认为没有这样的 API,也没有用于发送 DTMF 的 API,原因与您无法判断调用何时连接的原因相同。
关于android - 检测拨出电话是否已接听,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2250455/