2
我已經使用瞭如下因素代碼撥一個號碼:如何檢查撥號號碼是忙還是未回答?
DataBaseHelper db;
db=new DataBaseHelper(PanicService.this);
try {
db.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
Map<String, String > map= db.TelephoneList();
String[] numbers = new String[]{"number1","number2","number3","number4","number5"};
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+map.get(numbers[0])));
callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(callIntent);
這是工作的罰款。 現在我需要知道撥號號碼是忙還是未答覆,它是撥打列表中的下一個號碼。我只是想知道是否有反應來檢測通話的狀態?
我已經檢查了這個URL http://developer.android.com/reference/android/telephony/TelephonyManager.html但是除了CALL_STATE_OFFHOOK之外,我找不到任何圍繞這個概念的東西,這實際上並不是我想要的。
如果有人能就此提出建議,我將不勝感激。
非常感謝提前。
任何意見表示讚賞。
謝謝你,那麼電話怎麼知道什麼時候掛斷? emmmm :) – 2012-07-12 14:32:27
當用戶按下「結束呼叫」按鈕或移動網絡斷開呼叫時,電話掛斷。你可以收到這些事件。 – 2012-07-12 14:49:54
哦,我從電話經理那裏看到了DATA_DISCONNECTED,對吧? – 2012-07-12 14:53:20