Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I create an Application to access, Edit, Update, Delete Contacts Details.
Here is a problem to updating Contact_Image.

When new contact Added by device outside the Application without image.
then we can't update contact Image.
My Updating Code is.
Java
ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
					.withSelection(Data.CONTACT_ID+"= ? AND "+ContactsContract.Data.MIMETYPE+"=?",new String[]{id,ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE})
					.withValue(ContactsContract.CommonDataKinds.Photo.PHOTO, imageInByte)
					.build());


Where ops is
Java
ArrayList<ContentProviderOperation>


Please Provide me solution regard this.
Thanks in Advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900