Wednesday, December 16, 2009

[android-developers] need help : insert chat address with new contact

my code gives no error but it does not save chat address
below is the code.

ContentValues chataddressValues = new ContentValues();
Uri chataddressUri = Uri.withAppendedPath(newPersonUri,
Contacts.People.ContactMethods.CONTENT_DIRECTORY);
chataddressValues.put(Contacts.ContactMethods.KIND, Contacts.KIND_IM);
chataddressValues.put( Contacts.ContactMethods.TYPE,
Contacts.ContactMethods.TYPE_OTHER);
chataddressValues.put(Contacts.ContactMethods.AUX_DATA,
Contacts.ContactMethods.encodePredefinedImProtocol(TYPE_PRECEDENCE_IM
[5])));
chataddressValues.put(Contacts.ContactMethods.DATA,"abcd@gmail.com");
getContentResolver().insert(chataddressUri,chataddressValues);

with same "newPersonUri" i am able to add other data (various numbers,
name, email, organization etc) successfully.
pleaze help me.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate