在安卓 2.1 中自动应答呼叫



我正在寻找一些代码来自动应答android 2.1中的来电。我已经查看了一些关于堆栈溢出的可用线程,但它们似乎不适用于 Android 2.1。

任何人都可以给一些代码的平静来帮助我。提前谢谢。

//设置与电话服务的通信(感谢 Tedd 的 Droid 工具!

TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephonyService;
telephonyService = (ITelephony)m.invoke(tm);
// Silence the ringer and answer the call!
telephonyService.silenceRinger();
telephonyService.answerRingingCall();

参考此链接1 链接2

最新更新