传出呼叫Android的回答状态2.2+ [英] Out going call answered state in Android 2.2+

查看:142
本文介绍了传出呼叫Android的回答状态2.2+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序启动的呼出,我使用PhoneStateListener了解呼叫状态。

In my application I initiated an outgoing call and I am using PhoneStateListener to know about call state.

每当我开始变得清晰拨打的电话状态是 TelephonyManager.CALL_STATE_OFFHOOK 。当通话接收方接了电话,我没有得到在手机的状态发生任何变化。

Whenever I start making call the phone state is TelephonyManager.CALL_STATE_OFFHOOK. When call recipient answered the call, I am not getting any change in phone's state.

我尝试了许多,但未能得到这个回答状态。有人告诉使用蓝牙的HFP(免提模式),以获得应答呼叫状态。但我没有得到有关HFP从Android开发者网站上的任何信息。

I tried many but failed to get this answered state. Somebody told use bluetooth's HFP (Hands Free Profile) to get call answered state. But I didn't get any information about HFP from android developers website.

如果有人遇到同样的问题,得到了解决,请提供您宝贵的意见。

If anybody faced same problem and got the solution, please give your valuable suggestions.

推荐答案

CALL_STATE_OFFHOOK 当呼叫被recepient回答不会改变:

The CALL_STATE_OFFHOOK doesn't change when the call is answered by the recepient:

设备通话状态:摘机。至少有一个呼叫存在,即正在拨号 有效或搁置,也没有电话振铃或等待。

Device call state: Off-hook. At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting.

国家不应该只要手机是改变呼叫,无论是回答还是不行。

The state shouldn't change as long as the phone is in call, whether it's answered or not.

这个问题已经问了许多项目,也是迄今为止没有任何的那些,我发现已经得到解决:<一href="http://stackoverflow.com/questions/2250455/detect-if-an-outgoing-call-has-been-answered">Detect如果传出的电话已经接,<一个href="http://stackoverflow.com/questions/9392804/android-how-to-get-a-state-that-the-outgoing-call-has-been-answered">Android :如何获得一个状态,即呼出已回答,<一个? href="http://stackoverflow.com/questions/9392804/android-how-to-get-a-state-that-the-outgoing-call-has-been-answered">Android :?如何获得状态传出呼叫已被应答(还有许多其他)。该解决方案提供了有依靠 CALL_STATE_OFFHOOK 状态,当呼叫接通后,这不会发生改变。

This question had been asked many items, and so far none of the those I found have been solved: Detect if an outgoing call has been answered, Android : How to get a state that the outgoing call has been answered?, Android : How to get a state that the outgoing call has been answered? (There are many others). The solutions provided there rely on the CALL_STATE_OFFHOOK state to change when the call is answered, which doesn't happen.

好像没有公开API,它可以被用来获取传出呼叫状态。我看到的最好的解决方法是什么的Vivek Khandelwal建议,这不是这么长时间code,也有沉重的性能开销。除非加入过多的权限(现在你需要添加 READ_CALL_LOGS )是一个问题,使用它。

Seems like there is no public API which can be used to get the outgoing call state. The best workaround I see is what Vivek Khandelwal suggested., it's not so long to code nor has heavy performance overheads. Unless adding too many permissions (Now you need to add READ_CALL_LOGS) is a problem, use it.

这篇关于传出呼叫Android的回答状态2.2+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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