【问题标题】:Android how to hold and unhold active phone callAndroid如何保持和取消保持活动电话
【发布时间】:2012-08-07 12:54:54
【问题描述】:

谁能告诉我如何保持和取消保持活动电话? 我正在尝试使用ITelephony.aidl 进行操作,但无法保持通话。这是我尝试保持活动通话的代码

TelephonyManager tm = (TelephonyManager) CallholdddActivity.this.getSystemService(Context.TELEPHONY_SERVICE);

                try{
                Class<?> c = Class.forName(tm.getClass().getName());
                Method m = c.getDeclaredMethod("getITelephony");
                m.setAccessible(true);
                com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
                telephonyService = (ITelephony) m.invoke(tm);
                //telephonyService.silenceRinger();
                // here what should i write , i dont know 
                //System.out.println(a);
                }
                catch (Exception e) {
                    // TODO: handle exception
                }
            }

【问题讨论】:

    标签: android phone-call telephonymanager


    【解决方案1】:

    使用 ITelephony.aidl 获得持有选项是完全不可能的,因为没有这样的方法。 最好使用任何使用音频管理器的方法来查找呼叫是否处于活动状态。但缺点是音频管理器也可以被其他应用程序使用。所以,要知道Mode就会有两难选择了!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-09
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2016-04-09
      相关资源
      最近更新 更多