How to remove a contact with a specified phone number?

I try this:

String phone ="1234567";
   context.getContentResolver().delete(Contacts.Phones.CONTENT_URI,
phone, null);

But I get an error with this:
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)
        at com.mytest.TestUtil.removeContact(TestUtil.java:87)


Thank you for any pointers.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to