Good day. There is a piece of code:

ContentValues value = new ContentValues(); value.put(Contacts.People.DISPLAY_NAME, "ФИО"); getContentResolver().update(Contacts.People.CONTENT_URI, value, Contacts.People._ID + "=?", new String[]{String.valueOf(id)}); //id - long типа 

It seems that everything corresponds, as in the example from Android developers . However, the error is:

java.lang.UnsupportedOperationException: Cannot update URL: content: // contacts / people

Tell me what am I doing wrong?

    1 answer 1

    The class Contacts.People deprecated - deprecated, now there is not even such a field as _ID , so I advise you to use ContactsContract.Data.CONTACT_ID instead of ContactsContract.Data.CONTACT_ID

    • I agree with you. This is true for android versions> 1.6 and I just have 1.6, so there is no such thing what to do? - wertklop