How to update contact fields individually?
<p>I am new to android, so thought of doing a small project on Native Contacts. Application should Add, Update &amp; Delete Native Contacts through my application.</p>

<p>Adding &amp; Deleting native contacts is working fine, but Update contacts is not working at all.</p>

<p>This is the code i am using for Update &amp; Delete :-</p>

<p>Delete :-</p>

<pre><code>cr.delete(uri, People._ID + "=" + id, null);
</code></pre>

<p>Update :-</p>

<pre><code>values.put("data1", "Student_Name");

cr.update(Uri.parse("content://com.android.contacts/data/"),
              values, "raw_contact_id=" + id, null);
</code></pre>

<p>Suppose i am adding a new contact in the Native itself i.e without using with my AddtoNative method :-</p>

<blockquote>
  <p>Name : Robert</p>
  
  <p>Home Phone : 111111111</p>
  
  <p>Work Phone : 222222222</p>
  
  <p>Mobile Phone: 333333333</p>
  
  <p>Work Fax  : 444444444</p>
  
  <p>Home Email : robert@gmail.com</p>
</blockquote>

<p>If I have use update code given below :-</p>

<pre><code>values.put("data1", "Student_Name");
cr.update(Uri.parse("content://com.android.contacts/data/"),
              values, "raw_contact_id=" + id, null);
</code></pre>

<p>All data gets updated and gives the result :-</p>

<blockquote>
  <p>Name          : Student_Name</p>
  
  <p>Home Phone : Student_Name</p>
  
  <p>Work Phone  : Student_Name</p>
  
  <p>Mobile Phone: Student_Name</p>
  
  <p>Work Fax     : Student_Name</p>
  
  <p>Home Email  : Student_Name</p>
</blockquote>

<p>But in update, I just want to only update Work phone number or Home Phone number or Home Email field.</p>

<p>Any suggestions guys.........</p>

<p>Thanks in Advance.</p>

<p>Regards
Raki</p>
