简体   繁体   English

自动接听android来电 2.1

[英]Automatically answer call in android 2.1

I am looking for some code to automatically answer incoming call in android 2.1.我正在寻找一些代码来自动接听 android 2.1 中的来电。 I have looked on some of the available threads on stack-overflow but they do not seem to work for Android 2.1.我查看了堆栈溢出上的一些可用线程,但它们似乎不适用于 Android 2.1。

Can anybody give some peace of code to help me.任何人都可以提供一些代码来帮助我。 Thanks in advance.提前致谢。

// Set up communication with the telephony service (thanks to Tedd's Droid Tools!) // 设置与电话服务的通信(感谢 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();

Refer this LINK1 LINK2参考这个LINK1 LINK2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM