I am trying to add a custom data field to a contact, its UID is known.
I have not yet understood what exactly I should do. I saw and tried
other code , but to no success.
public static final String FORMALITY = "vnd.android.cursor.item/
some_text";
public void foo(ContentResolver cr)
{
ContentValues values = new ContentValues();
values.put(ContactsContract.Data.DATA1, "xyz");
String su = ContactsContract.Data.CONTACT_ID + "=" + uID + " AND " +
ContactsContract.Data.MIMETYPE + "= '" + FORMALITY + "'";
int mod =
cr.update(ContactsContract.Data.CONTENT_URI,values,su, null);
}
and "mod" is always 0.
What should I do ?
Thanks.
--
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en