The following code is used to update the image but it throws illegal or bad value exception.any body can solve this.
Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap();
File f = new File(picturePath);
Uri photoUri = Uri.fromFile(f);
add to array list coding
ops.add(ContentProviderOperation
.newUpdate(ContactsContract.Data.CONTENT_URI)
.withSelection(
ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?",
new String[] {
contactid,
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE })
.withValue(Photo.Photo_Uri,photoUri ).build());
Here is one way:
Try the following
insted of this replace the following.
and your array list adding code should be.