delete contacts on a background thread
This commit is contained in:
parent
fd01e27122
commit
4cbe122672
1 changed files with 19 additions and 17 deletions
|
|
@ -1044,6 +1044,7 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun deleteContacts(contacts: ArrayList<Contact>) {
|
fun deleteContacts(contacts: ArrayList<Contact>) {
|
||||||
|
Thread {
|
||||||
val localContacts = contacts.filter { it.source == SMT_PRIVATE }.map { it.id.toString() }.toTypedArray()
|
val localContacts = contacts.filter { it.source == SMT_PRIVATE }.map { it.id.toString() }.toTypedArray()
|
||||||
activity.dbHelper.deleteContacts(localContacts)
|
activity.dbHelper.deleteContacts(localContacts)
|
||||||
|
|
||||||
|
|
@ -1064,5 +1065,6 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
activity.showErrorToast(e)
|
activity.showErrorToast(e)
|
||||||
}
|
}
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue