2013-04-10 60 views

回答

2

从上面的链接,我们只能显示默认的通话记录。

0

这可以通过使用CallHistoryService API提供OS 10.3.0

下面是一些示例代码来获取所有通话和输出数字到日志来完成:

CallHistoryService callHistoryService; 

    // The ID of a valid account is required 
    bb::pim::account::Account defaultAccount = 
           callHistoryService.defaultAccount(); 

    // The default filter will return all calls 
    CallHistoryFilter defaultFilter; 

    // Contact search can be used to identify the contacts 
    CallHistoryParam callHistoryParams; 
    callHistoryParams.setContactSearchEnabled(false); 

    QList<CallEntryResult> callHistoryResults = 
          callHistoryService.callHistory(
           defaultAccount.id(), 
           defaultFilter, 
           callHistoryParams); 


    foreach (const CallEntryResult &callEntryResult, callHistoryResults) { 
     CallEntry callEntry = callEntryResult.call(); 
     qDebug << "Phone number: " << callEntry.phoneNumber(); 
    }