Problem in updating contact email address
<p>I am trying to update contact email address using this code</p>

<pre><code>String selectEmail = ContactsContract.Data.CONTACT_ID + "=? AND " + ContactsContract.Data.MIMETYPE + "='"  + 
    ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE + "'";
    String[] emailArgs = new String[]{Id}; 
    ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
    .withSelection(selectEmail, emailArgs)
    .withValue(ContactsContract.CommonDataKinds.Email.DATA, email)
    .build()); 
</code></pre>

<p>I am getting "Id" using this code</p>

<pre><code>String[] returnVals = new String[] {ContactsContract.CommonDataKinds.Phone.CONTACT_ID};
   this.cur = this.cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, 
               returnVals, 
               ContactsContract.CommonDataKinds.Phone.NUMBER + " = \"" + phoneNumber + "\"", 
               null, 
               null);
</code></pre>

<p>My questions are</p>

<p>1) Am I using correct way for getting Contact_ID using Phone number?
2) Contacts are not updating correctly, it is changing all fields like email, name and number.Am I doing some thing wrong?</p>

<p>Need help</p>
