fix #135, delete carddav contacts from RawContacts table

This commit is contained in:
tibbi 2018-04-30 10:22:48 +02:00
parent d2ce5f2772
commit 09298c9dde
1 changed files with 3 additions and 3 deletions

View File

@ -1220,10 +1220,10 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
try {
val operations = ArrayList<ContentProviderOperation>()
val selection = "${ContactsContract.Data.CONTACT_ID} = ?"
val selection = "${ContactsContract.RawContacts._ID} = ?"
contacts.filter { it.source != SMT_PRIVATE }.forEach {
ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI).apply {
val selectionArgs = arrayOf(it.contactId.toString())
ContentProviderOperation.newDelete(ContactsContract.RawContacts.CONTENT_URI).apply {
val selectionArgs = arrayOf(it.id.toString())
withSelection(selection, selectionArgs)
operations.add(build())
}