I would like to update the CallLog.Calls.TYPE
field of the first entry in the Android Call Log from MISSED
to INCOMING
. I have read books, the developers reference and googled this to death and am reasonably sure that my code is correct. However, when I actually make the call to update()
, the result is that no record is updated. My code sample is below.
Before you ask:
- I have permissions for WRITE_CONTACTS
- The record to be updated (0) does exist
- I have tried this on both a DroidX (Verizon) and a Samsung Galaxy (AT&T)
- I have tried various other, longer forms of this code with same result
Can someone please help with this?
ContentValues newValues = new ContentValues();
newValues.put(CallLog.Calls.TYPE, CallLog.Calls.INCOMING_TYPE);
newValues.put(CallLog.Calls.DURATION, 50);
int result = OsmoService.context.getContentResolver().update(
ContentUris.withAppendedId(CallLog.Calls.CONTENT_URI, 0),
newValues,null,null);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…