catch and show exceptions thrown at sending a message
This commit is contained in:
parent
7f6343c354
commit
a65916c54e
1 changed files with 5 additions and 1 deletions
|
|
@ -72,7 +72,11 @@ fun Context.sendMessage(text: String, addresses: List<String>, subscriptionId: I
|
||||||
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
|
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
|
||||||
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
|
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
transaction.sendNewMessage(message)
|
try {
|
||||||
|
transaction.sendNewMessage(message)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue