diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt index 8249e94b8..b996a37ac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt @@ -182,10 +182,13 @@ class SettingsActivity : SimpleActivity() { config.caldavSync = false settings_manage_synced_calendars_holder.beGone() settings_caldav_pull_to_refresh_holder.beGone() - config.getSyncedCalendarIdsAsList().forEach { - CalDAVHandler(applicationContext).deleteCalDAVCalendarEvents(it.toLong()) - } - dbHelper.deleteEventTypesWithCalendarId(config.caldavSyncedCalendarIDs) + + Thread { + config.getSyncedCalendarIdsAsList().forEach { + CalDAVHandler(applicationContext).deleteCalDAVCalendarEvents(it.toLong()) + } + dbHelper.deleteEventTypesWithCalendarId(config.caldavSyncedCalendarIDs) + }.start() } }