本文介绍了如何获得呼出的连接状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序的开发,我需要做的震动时呼出连接,但我不能得到应答呼叫状态。我看了一下这个问题,比如一些话题:
    

In my application development, I need to do vibration when outgoing call connected, but I can not get the call answered state. I have read some topic about this question, such as: Outgoing call status

但实际上,这些问题不能正确回答。利用广播接收器只能接收空闲,摘机,振铃状态,但没有激活状态。

But actually, these questions not be answered correctly. Use BroadcastReceiver can only receive idle, offhook, ringing states, but no active state.

在内部框架Call.java定义的活动状态,我也没办法让这种状态。我确实使用了反射法,几乎一样,但也失败了。

The active state defined in Call.java in internal framework, I have no idea to get this state. I did use reflection method, almost same as Accessing CallManager in Android, But failed also.

推荐答案

想知道和在网络上花费了大量的时间后,我找到了一种方法来实现这个...

After wondering and spending a lot of time on the net I found a way to achieve this...

刚刚查询的基础上你的最后已拨电话时设备的通话记录,获取该呼叫的持续时间,如果发现大于0,则表示你的电话已经被接受,它完美的作品。

Just query the call history of the device based on time of your last dialed call, fetch the duration of that call, if found greater than 0 that means your call was accepted and it works perfect.

如果有人无法得到它,让我知道我会与code细说吧。

if someone unable to get it, lets me know I will elaborate it with code.

这篇关于如何获得呼出的连接状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 11:12