I find the documentation on custom data types for contacts very sparse
and the only example I can find in the documentation doesn't seem to
work.  I am trying to add a custom field to all my contacts, called
"isBusiness", which will hold a true or false.  I want to be able to
add this field and set its value for any rawcontact of my choosing.
Can someone give an example, from the creation of the data to insert
right up to the actual insert/update, including how to define the
CONTENT_ITEM_TYPE (is it just Boolean.CONTENT_ITEM_TYPE?), etc...

The example I found in the documentation (with my questions inline):

 values.put(Data.RAW_CONTACT_ID, rawContactId);
 values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
    // I assume I need to put the mime type of the data I'm inserting
- what's the mime type for a boolean?
 values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan");
    // Since I'm adding isBusiness, what should I use for the first
argument, and where do I define this constant?
 getContentResolver().insert(Data.CONTENT_URI, values);
    // Data doesn't seem to have a CONTENT_URI defined... what should
I use instead?

Thank you for any help you can give me!
-Dan W

-- 
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

Reply via email to