I wrote an application and added 2 contacts to the emulator, but I canβt update their names on Android 2.1, the code works on the android 1.6 platform with the following code.
ContentValues contactValues = new ContentValues();
contactValues.put(Contacts.People.NAME, firstName+" "+lastName);
getContentResolver().update(UpdateContactUri, contactValues, null,
null);
In android 1.6, I get Uri for these two contacts: content: // contacts / people / 1 "and" content: // contacts / people / 2 ".
but in 2.1 I get these values: "content: // contacts / people / 8" and "content: // contacts / people / 9" and when updating it Exception java.IllegalArgumentException, Empty values.
When I tried to set the static Uri as "content: // contacts / people / 1", the code was debugged successfully, but the contact was not updated.
How can I solve it, why am I not getting uri like platform 1.6?
Thanks in advance...