I am trying to access call logs through android application. I have taken data through app and update the value of database but after updating I can't get the updated values in call list.
code I tried below:
Uri allCalls = Uri.parse("content://call_log/calls");
Cursor c = managedQuery(allCalls, null, null, null, null);
if (c.moveToFirst()) {
do {
String callType = "";
switch (
Integer.parseInt(c.getString(c.getColumnIndex(Calls.TYPE)))
) {
case 1: callType = "Incoming";
break;
case 2: callType = "Outgoing";
break;
case 3: callType = "Missed";
}
} while (c.moveToNext());
}
ContentValues values = new ContentValues();
values.put("name", "Unknown");
int k = getContentResolver().update(allCalls, values,null, null);
I got the integer value for k as how many number of rows updated but in call list I didnt get updated value.
Edit: I am able to insert and delete the call list values and when I check in call list it shows the result as inserting new row or deleting the existing one But when I update the values I can update, it return values as result of update query when I check by clicking callLog list, update value remain for a fraction of second and then old value displaying...
I don't know where I made a mistake, please help me...