title: How to remove a contact programmatically in android
body: <p>I try the following code to remove contact with a specified number:</p>
  
  <pre><code>private void removeContact(Context context, String phone) {
      //context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, phone, null);
      context.getContentResolver().delete(Contacts.Phones.CONTENT_URI,
            Contacts.PhonesColumns.NUMBER+"=?", new String[] {phone});
  }
  </code></pre>
  
  <p>But I get this exception:</p>
  
  <pre><code>java.lang.UnsupportedOperationException: Cannot delete that URL: content://contacts/phones
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:130)
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:110)
      at android.content.ContentProviderProxy.delete(ContentProviderNative.java:362)
      at android.content.ContentResolver.delete(ContentResolver.java:386)
  </code></pre>
  
  <p>Can you please tell me how to fix my problem?</p>
  
  <p>Thank you.</p>