mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-04 20:47:42 +01:00
catch and show security exceptions thrown at scheduling reminders
This commit is contained in:
parent
dd4a2c3d2b
commit
acfec5901d
@ -124,7 +124,11 @@ fun Context.scheduleEventIn(notifTS: Long, event: Event, showToasts: Boolean) {
|
||||
|
||||
val pendingIntent = getNotificationIntent(applicationContext, event)
|
||||
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, newNotifTS, pendingIntent)
|
||||
try {
|
||||
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, newNotifTS, pendingIntent)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.cancelNotification(id: Long) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user