mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-14 19:00:54 +01:00
hide the event notification if the edit screen opens in any way
This commit is contained in:
parent
984769a438
commit
012ceeb5d3
@ -89,6 +89,8 @@ class EventActivity : SimpleActivity() {
|
||||
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
||||
mEvent.id = 0
|
||||
}
|
||||
|
||||
cancelNotification(mEvent.id)
|
||||
} else {
|
||||
mEvent = Event()
|
||||
mReminder1Minutes = config.defaultReminderMinutes
|
||||
|
@ -119,8 +119,7 @@ fun Context.scheduleEventIn(notifTS: Long, event: Event, activity: SimpleActivit
|
||||
}
|
||||
|
||||
fun Context.cancelNotification(id: Int) {
|
||||
val intent = Intent(applicationContext, NotificationReceiver::class.java)
|
||||
PendingIntent.getBroadcast(applicationContext, id, intent, PendingIntent.FLAG_UPDATE_CURRENT).cancel()
|
||||
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).cancel(id)
|
||||
}
|
||||
|
||||
private fun getNotificationIntent(context: Context, event: Event): PendingIntent {
|
||||
|
Loading…
x
Reference in New Issue
Block a user