Thursday, July 28, 2011

Delete contacts from Android device

We can delete the contacts from android device programmatically.

Declare the permissions in manifest file:



Using Android 1.6 :
getContentResolver().delete(Contacts.People.CONTENT_URI,null,null);

Using Android 2.0 and above:
getContentResolver().delete(ContactsContract.RawContacts.CONTENT_URI,null,
null);