Remove contact fixed
This commit is contained in:
parent
bc38b75e9e
commit
04335fb7fd
1 changed files with 6 additions and 6 deletions
|
@ -229,13 +229,13 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
||||||
|
|
||||||
private void deleteExistingContact() {
|
private void deleteExistingContact() {
|
||||||
String select = ContactsContract.Data.CONTACT_ID + " = ?";
|
String select = ContactsContract.Data.CONTACT_ID + " = ?";
|
||||||
String[] args = new String[] { contact.getID() };
|
String[] args = new String[] { contact.getID() };
|
||||||
|
|
||||||
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
|
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
|
||||||
ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
|
ops.add(ContentProviderOperation.newDelete(ContactsContract.RawContacts.CONTENT_URI)
|
||||||
.withSelection(select, args)
|
.withSelection(select, args)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getActivity().getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
|
getActivity().getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
|
||||||
|
|
Loading…
Reference in a new issue