I tried different methods, but field wasn't updated.

1.
ContentValues values = new ContentValues();
values.put(People.NAME, "New name");
getContentResolver().update(People.CONTENT_URI, values, "people._id="
+ contactId, null);

===================
2.

String[] projection = new String[] {
                        android.provider.BaseColumns._ID,
                        PeopleColumns.NAME
                                };
        Cursor cursor = managedQuery(People.CONTENT_URI, projection,
"people._id=" + contactId, null);

        if (cursor2.first()){
                int contactNameColumnIndex =
cursor.getColumnIndex(PeopleColumns.NAME);
                cursor.update(contactNameColumnIndex, "new name");


Does anybody knows, what's the problem? In Manifest:

        <uses-permission android:name="android.permission.READ_CONTACTS" />
        <uses-permission android:name="android.permission.WRITE_CONTACTS" />
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to