安卓手机通话过程中检测当前活动的电话号码 [英] Android: Detect currently active phone number during phone call

查看:109
本文介绍了安卓手机通话过程中检测当前活动的电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标:在Android平台上,检测个人的电话号码,用户与之说话到现在

Goal: On the Android platform, detect the phone number of the individual with whom the user is speaking to now.

目前,使用PhoneListener,存在一定的歧义保留呼叫的情况下

Currently, using PhoneListener, there exists a certain ambiguity in the case of calls on hold.

案例:用户在通话过程中与人交谈(呼1)。因此,用户在通话状态OFFHOOK。然后,用户处于状态化铃声指示接听来电(CALL 2)。国家再变为摘机。这可能表明两种可能性之一 - 无论是用户接电话2,和已拨电话1搁置。或者,用户拒绝呼叫2并返回给呼叫1

Case: User is talking to someone during a call ("Call 1"). The user is therefore in call state OFFHOOK. Then the user is in state RINGING indicating an incoming phone call ("Call 2"). The state then changes to OFFHOOK. This could indicate one of two possibilities -- either the user answered Call 2, and placed Call 1 on hold. Alternatively, the user rejected Call 2 and returned to Call 1.

这怎么可能这两种情况之间的区别?是否有可能检测到手机上当前呼叫的电话号码吗?

How is it possible to distinguish between the two cases? Is it possible to detect the phone number of the CURRENT CALL on the phone?

推荐答案

使用一个PhoneStateLister和<一href="http://developer.android.com/reference/android/telephony/PhoneStateListener.html#onCallStateChanged%28int,%20java.lang.String%29"相对=nofollow> onCallStateChanged 。  在那里,你还可以看到来电号码。

Use a PhoneStateLister and onCallStateChanged. There you can also see the incoming number.

这篇关于安卓手机通话过程中检测当前活动的电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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