public boolean isTelephonyCalling(){ boolean calling = false; TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if(TelephonyManager.CALL_STATE_OFFHOOK==telephonyManager.getCallState()||TelephonyManager.CALL_STATE_RINGING==telephonyManager.getCallState()){ calling = true; } return calling;}

 TelephonyManager 中的定义   :

/** Device call state: No activity. */    public static final int CALL_STATE_IDLE = 0; //空闲状态    /** Device call state: Ringing. A new call arrived and is     *  ringing or waiting. In the latter case, another call is     *  already active. */    public static final int CALL_STATE_RINGING = 1; //振铃状态    /** Device call state: Off-hook. At least one call exists      * that is dialing, active, or on hold, and no calls are ringing      * or waiting. */    public static final int CALL_STATE_OFFHOOK = 2; //至少有一个通话存在


更多相关文章

  1. Android:监听WIFI网络状态
  2. android监听手机网络连接状态改变的后台服务
  3. android 实时检测网络状态
  4. android 把图片状态由彩色变成灰色
  5. android中gridView中点击 item为选中状态
  6. android屏幕监听,手机是否处于锁屏状态,在锁屏之上弹出Toast.makeT
  7. 禁止状态栏下拉
  8. Android中View(视图)绘制不同状态背景图片原理深入分析以及State

随机推荐

  1. Android系统通过手机USB进行网络共享设置
  2. 创建一个ArcGIS for Android(安卓)新项目
  3. Android(安卓)屏幕旋转 处理 AsyncTask
  4. android 按钮
  5. Windows系统下的Android开发环境搭建
  6. What Android(安卓)Can Learn From the i
  7. Android单元测试遇到的问题
  8. Android入门第十二篇之Gallery
  9. Android获取应用程序的版本名称和版本号
  10. Linux 下Android(安卓)开发环境搭建 ---Cent