use a background thread for deleting CalDAV events after disabling sync

This commit is contained in:
tibbi 2018-11-11 22:42:32 +01:00
parent f7e3717ed1
commit e3decbe1b6
1 changed files with 7 additions and 4 deletions

View File

@ -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()
}
}