title: update contact details on Android
body: <p>I would like my code to update <strong>contact details</strong> (like name, phone number, email, organization details, etc) in the android contact book. I was successful in modifying a few (name, phone number and email to be specific) but not all.</p>
  
  <p>Whenever I try to update the organization details (Contacts.Organizations.COMPANY and Contacts.Organizations.TITLE) for a contact my app throws an <strong>exception</strong> </p>
  
  <pre><code>java.lang.UnsupportedOperationException: Cannot update URL: content://contacts/people/69/organizations/69
  </code></pre>
  
  <p>the code snippet is as follows:</p>
  
  <pre><code>Uri baseUri = ContentUris.withAppendedId(People.CONTENT_URI, 69);
  Uri uri = Uri.withAppendedPath(baseUri, People.Phones.CONTENT_DIRECTORY);
  Cursor c = this.getContentResolver().query(uri, 
                  new String[] { Contacts.Organizations._ID, Contacts.Organizations.COMPANY,Contacts.Organizations.TITLE}, 
                  null, null, null);
  if(c.getCount() &gt; 0) {
        uri = ContentUris.withAppendedId(uri, c.getString(0));
  ContentValues val1 = new ContentValues();
  val1.put(Contacts.Organizations.COMPANY, "arw");
  val1.put(Contacts.Organizations.TYPE, Contacts.Organizations.TYPE_WORK);
  val1.put(Contacts.Organizations.TITLE, "abcdef");
  this.getContentResolver().insert(uri, val1);
  </code></pre>