i am writing a application of backup contacts.
i need to delete contacts and groups before  restore  from backup
file.
the contacts were deleted but the gourps were not .who can tell me how
to do it.

          getContentResolver().delete(
                                ContactsContract.RawContacts.CONTENT_URI, null, 
null);


                String where = ContactsContract.Data.MIMETYPE + " = ?";
                String[] whereParameters = new String[]
{ GroupMembership.CONTENT_ITEM_TYPE };

                getContentResolver().delete(
                                ContactsContract.Data.CONTENT_URI, where, 
whereParameters);

                getContentResolver().delete(
                                ContactsContract.Groups.CONTENT_URI,
                                ContactsContract.Groups.SYSTEM_ID + " is null 
and "
                                                + ContactsContract.Groups._ID + 
" > "
                                                + GROUP_ID_STARRED_IN_ANDROID, 
null);

                // notify registered observers that a row was updated
        
getContentResolver().notifyChange(ContactsContract.Groups.CONTENT_URI,
                                null);

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

Reply via email to