Problem updating android contact picture with ContentResolver.Update()
<p>I am new to android. My requirement is to update contact picture with the selected one. Below is the code I am writing to implement this</p>

<pre><code>byte[] imageBytes = imgContactPhoto.getDrawable().toString().getBytes();

        ContentValues values = new ContentValues();
    values.put(ContactsContract.Data.RAW_CONTACT_ID, contactId);
    values.put(ContactsContract.Data.IS_SUPER_PRIMARY, 1);
    values.put(ContactsContract.CommonDataKinds.Photo.PHOTO, imageBytes);
    values.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE);

    Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(contactId));
    cr.update(uri, values, ContactsContract.Contacts._ID + " = " + contactId, null);
</code></pre>

<p>imgContactPhoto is the ImageView, in the first line, I am extracting Bytes array of the image set upon it and updating the contact (with cotact id = contacted). 
When I debug the code, it passes all the above statements smoothly without any exception, but the contact picture is not updated.When I check the values of uri and values during debug in new watch, 
"uri"             uri cannot be resolved to a variable<br>
"values"        values cannot be resolved to a variable   </p>

<p>Any help is appreciated.</p>
