[mono-android] adding a contact

Wally McClure theevilprogrammer at hotmail.com
Mon Jan 9 20:50:45 EST 2012


I'm trying to add a new contact based on adding a record: http://developer.android.com/guide/topics/providers/content-providers.html

My code is:
           ContentValues values = new ContentValues();
            // Add Abraham Lincoln to contacts and make him a favorite.
 
            values.Put(Android.Provider.Contacts.PeopleColumns.Name, "Abraham Lincoln");
            // 1 = the new contact is added to favorites
            // 0 = the new contact is not added to favorites
            values.Put(Android.Provider.Contacts.PeopleColumns.Starred, 1);
 
            var uri = cr.Insert(ContactsContract.Contacts.ContentUri, values);
Unfortunately, I'm getting the following error on the insert:
Unhandled Exception:

Java.Lang.UnsupportedOperationException: Aggregate contacts are created automatically

Any help on resolving this exception is appreciated.

Wally
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20120109/e323141b/attachment.html 


More information about the Monodroid mailing list