show exceptions thrown at triggering notifications

This commit is contained in:
tibbi 2019-09-17 10:34:08 +02:00
parent 111c155ea8
commit 842f054407
2 changed files with 6 additions and 2 deletions

View File

@ -58,7 +58,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.16.17'
implementation 'com.simplemobiletools:commons:5.17.17'
implementation 'joda-time:joda-time:2.10.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'

View File

@ -197,7 +197,11 @@ fun Context.notifyEvent(originalEvent: Event) {
ensureBackgroundThread {
val notification = getNotification(pendingIntent, event, content)
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
try {
notificationManager.notify(event.id!!.toInt(), notification)
} catch (e: Exception) {
showErrorToast(e)
}
}
}