as we know,if we want to add phone number or email adress into Content
Provider,we can write codes as follow
---------------------------------------------------------------------------
ArrayList<ContentProviderOperation> ops = new
ArrayList<ContentProviderOperation>();
                        int rawContactInsertIndex = ops.size();
                        
ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)
                                        .withValue(RawContacts.ACCOUNT_TYPE, 
null)
                                        .withValue(RawContacts.ACCOUNT_NAME, 
null)
                                        .build());
ops.add(ContentProviderOperation.newInsert(android.provider.ContactsContract.Data.CONTENT_URI)
                                         
.withValueBackReference(Data.RAW_CONTACT_ID,
rawContactInsertIndex)
                                 .withValue(Data.MIMETYPE, 
Phone.CONTENT_ITEM_TYPE)
                                 .withValue(Phone.NUMBER, "13671323809")
                                 .withValue(Phone.TYPE, Phone.TYPE_MOBILE)
                                 .withValue(Phone.LABEL, "phone")
                                 .build());
        
ops.add(ContentProviderOperation.newInsert(android.provider.ContactsContract.Data.CONTENT_URI)
                                         
.withValueBackReference(Data.RAW_CONTACT_ID,
rawContactInsertIndex)
                                 .withValue(Data.MIMETYPE, 
Email.CONTENT_ITEM_TYPE)
                                 .withValue(Email.DATA, "[email protected]")
                                 .withValue(Email.TYPE, Email.TYPE_WORK)
                                 .build());

------------------------------------------------
and my question is that :
if I want to add picture into the Content Provider so how  should i
wirte the codes??
waiting for your answer,and thanks  for your replying.

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