tweak deleting contacts from groups a bit

This commit is contained in:
tibbi 2018-03-20 14:24:14 +01:00
parent 4fca6ce711
commit 67cf029e91
2 changed files with 3 additions and 3 deletions

View File

@ -27,9 +27,9 @@ import com.simplemobiletools.contacts.models.*
import kotlinx.android.synthetic.main.activity_edit_contact.* import kotlinx.android.synthetic.main.activity_edit_contact.*
import kotlinx.android.synthetic.main.item_edit_address.view.* 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_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_edit_phone_number.view.*
import kotlinx.android.synthetic.main.item_event.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.DateTime
import org.joda.time.format.DateTimeFormat import org.joda.time.format.DateTimeFormat
import java.util.* import java.util.*

View File

@ -670,8 +670,8 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
if (relevantGroupIDs.isNotEmpty()) { if (relevantGroupIDs.isNotEmpty()) {
val IDsString = TextUtils.join(",", relevantGroupIDs) val IDsString = TextUtils.join(",", relevantGroupIDs)
ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI).apply { ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI).apply {
val selection = "${ContactsContract.Data.RAW_CONTACT_ID} = ? AND ${ContactsContract.Data.MIMETYPE} = ? AND ${ContactsContract.Data.DATA1} IN (?)" 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, IDsString) val selectionArgs = arrayOf(contact.id.toString(), CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE)
withSelection(selection, selectionArgs) withSelection(selection, selectionArgs)
operations.add(build()) operations.add(build())
} }