From 67cf029e918a0240c16cf5f40f78e0e1b9315f38 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Mar 2018 14:24:14 +0100 Subject: [PATCH] tweak deleting contacts from groups a bit --- .../contacts/activities/EditContactActivity.kt | 2 +- .../com/simplemobiletools/contacts/helpers/ContactsHelper.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/EditContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/EditContactActivity.kt index 9729b28d..b88e05db 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/EditContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/EditContactActivity.kt @@ -27,9 +27,9 @@ import com.simplemobiletools.contacts.models.* import kotlinx.android.synthetic.main.activity_edit_contact.* import kotlinx.android.synthetic.main.item_edit_address.view.* import kotlinx.android.synthetic.main.item_edit_email.view.* +import kotlinx.android.synthetic.main.item_edit_group.view.* import kotlinx.android.synthetic.main.item_edit_phone_number.view.* import kotlinx.android.synthetic.main.item_event.view.* -import kotlinx.android.synthetic.main.item_edit_group.view.* import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat import java.util.* diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt index 8a86c144..8b9d93fe 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -670,8 +670,8 @@ class ContactsHelper(val activity: BaseSimpleActivity) { if (relevantGroupIDs.isNotEmpty()) { val IDsString = TextUtils.join(",", relevantGroupIDs) ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI).apply { - val selection = "${ContactsContract.Data.RAW_CONTACT_ID} = ? AND ${ContactsContract.Data.MIMETYPE} = ? AND ${ContactsContract.Data.DATA1} IN (?)" - val selectionArgs = arrayOf(contact.id.toString(), CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE, IDsString) + val selection = "${ContactsContract.Data.RAW_CONTACT_ID} = ? AND ${ContactsContract.Data.MIMETYPE} = ? AND ${ContactsContract.Data.DATA1} IN ($IDsString)" + val selectionArgs = arrayOf(contact.id.toString(), CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE) withSelection(selection, selectionArgs) operations.add(build()) }