From 9e06f1f338c5a30a3403191d8a7a74dfcf693cd5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 11 Nov 2018 23:53:47 +0100 Subject: [PATCH] handle a couple more threading issues related to storing events --- .../calendar/pro/activities/EventActivity.kt | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt index 7ff029ce8..e76ca0d09 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt @@ -797,22 +797,26 @@ class EventActivity : SimpleActivity() { private fun showEditRepeatingEventDialog() { EditRepeatingEventDialog(this) { if (it) { - dbHelper.update(mEvent, true, this) { - finish() - } + Thread { + dbHelper.update(mEvent, true, this) { + finish() + } + }.start() } else { - dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true) - mEvent.apply { - parentId = id!!.toLong() - id = null - repeatRule = 0 - repeatInterval = 0 - repeatLimit = 0 - } + Thread { + dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true) + mEvent.apply { + parentId = id!!.toLong() + id = null + repeatRule = 0 + repeatInterval = 0 + repeatLimit = 0 + } - dbHelper.insert(mEvent, true, this) { - finish() - } + dbHelper.insert(mEvent, true, this) { + finish() + } + }.start() } } }