如何让我的Andr​​oid应用程序检测掉话? [英] How can my android app detect a dropped call?

查看:129
本文介绍了如何让我的Andr​​oid应用程序检测掉话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的是指通话过程中运行的应用程序。在用户进行呼叫,并开始我的应用程序,我想我的应用程序才能够知道呼叫来自接触不良下降。这可能吗?谢谢

I am writing an app that is meant to be run during a call. After the user makes a call, and starts my app, I want my app to be able to know if the call is dropped from bad connection. Is this possible? Thanks

推荐答案

Android的 TelephonyManager 类提供了 getCallState()方法,它会告诉你当前呼叫的状态。你会寻找一个过渡,从 CALL_STATE_OFFHOOK CALL_STATE_IDLE

The Android TelephonyManager class provides the getCallState() method, which will tell you the status of the current call. You'll be looking for a transition from CALL_STATE_OFFHOOK to CALL_STATE_IDLE.

不幸的是,我看不出有什么方法来注册一个回调,所以你可能不得不求助于投票。

Unfortunately, I don't see any methods in there to register a callback, so you may have to resort to polling.

http://developer.android.com/reference/android/telephony/TelephonyManager.html

这篇关于如何让我的Andr​​oid应用程序检测掉话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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