1

我有阅读通话记录的代码

    String[] strFields = {
        android.provider.CallLog.Calls.DATE, 
        android.provider.CallLog.Calls.TYPE,
        android.provider.CallLog.Calls.DURATION,
        android.provider.CallLog.Calls.NUMBER
        };
//READ CALL LOG     
Cursor callCursor = getContentResolver().query(android.provider.CallLog.Calls.CONTENT_URI,strFields, null, null,android.provider.CallLog.Calls.DATE + " ASC");
startManagingCursor(callCursor);

int dateColumn = callCursor.getColumnIndex(android.provider.CallLog.Calls.DATE);
// type can be: Incoming, Outgoing or Missed
int typeColumn = callCursor.getColumnIndex(android.provider.CallLog.Calls.TYPE);
// get duration of calls
int durationColumn = callCursor.getColumnIndex(android.provider.CallLog.Calls.DURATION);
// get number
int numberColumn = callCursor.getColumnIndex(android.provider.CallLog.Calls.NUMBER);
Calendar calendarCall = Calendar.getInstance();

if(callCursor.moveToFirst()){
do{         
    callDate = callCursor.getLong(dateColumn);
    callType = callCursor.getInt(typeColumn);   
    callDuration = callCursor.getInt(durationColumn);
    callNumber = callCursor.getString(numberColumn);

    switch(callType){
        case android.provider.CallLog.Calls.INCOMING_TYPE:

            break;
        case android.provider.CallLog.Calls.MISSED_TYPE:

            break;
        case android.provider.CallLog.Calls.OUTGOING_TYPE:                      

            break;
    }
}while(callCursor.moveToNext());    
}

现在的问题是 Viber 调用也包括在内,但我想排除它们。有没有办法从通话记录中排除 Viber 通话?谢谢

4

1 回答 1

0

取决于标志/列。您是否找到任何可以帮助您识别 Viber 呼叫的标志?如果没有,则无法从日志中获取它。

于 2013-07-31T08:06:31.993 回答