mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-01-31 16:04:54 +01:00
fix #185, prefer the contact Mobile phone number at sending batch SMS
This commit is contained in:
parent
170d7438f8
commit
15316f0103
@ -105,10 +105,10 @@ fun BaseSimpleActivity.shareContacts(contacts: ArrayList<Contact>) {
|
||||
fun BaseSimpleActivity.sendSMSToContacts(contacts: ArrayList<Contact>) {
|
||||
val numbers = StringBuilder()
|
||||
contacts.forEach {
|
||||
it.phoneNumbers.forEach {
|
||||
if (it.value.isNotEmpty()) {
|
||||
numbers.append("${it.value};")
|
||||
}
|
||||
val number = it.phoneNumbers.firstOrNull { it.type == ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE }
|
||||
?: it.phoneNumbers.firstOrNull()
|
||||
if (number != null) {
|
||||
numbers.append("${number.value};")
|
||||
}
|
||||
|
||||
val uriString = "smsto:${numbers.toString().trimEnd(';')}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user