如何从CallLog中找出确切的呼叫持续时间(以毫秒为单位)?
我只得到四舍五入的数字。
Uri allCalls = Uri.parse("content://call_log/calls");
Cursor c = getActivity().getBaseContext().getContentResolver().query(allCalls, null, null, null, null);
if(c != null && c.moveToFirst()) {
int type = Integer.parseInt(c.getString(c.getColumnIndex(CallLog.Calls.TYPE)));// for call type, Incoming or out going
if (type == 2){
long duration = c.getLong(c.getColumnIndex(CallLog.Calls.DURATION));
}
}
c.close();