mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
catch and show exceptions thrown at adding blocked numbers
This commit is contained in:
@ -332,7 +332,11 @@ fun Context.getBlockedNumbers(): ArrayList<BlockedNumber> {
|
|||||||
fun Context.addBlockedNumber(number: String) {
|
fun Context.addBlockedNumber(number: String) {
|
||||||
ContentValues().apply {
|
ContentValues().apply {
|
||||||
put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, number)
|
put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, number)
|
||||||
|
try {
|
||||||
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user