簡體   English   中英

自動接聽android來電 2.1

[英]Automatically answer call in android 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();

參考這個LINK1 LINK2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM