stop caldav update listener if CalDAV sync is turned off
This commit is contained in:
parent
5ee263f3b6
commit
05e593e781
|
@ -163,6 +163,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
super.onDestroy()
|
||||
if (!isChangingConfigurations) {
|
||||
EventsDatabase.destroyInstance()
|
||||
stopCalDAVUpdateListener()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -290,6 +291,15 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
}
|
||||
}
|
||||
|
||||
private fun stopCalDAVUpdateListener() {
|
||||
if (isNougatPlus()) {
|
||||
if (!config.caldavSync) {
|
||||
val updateListener = CalDAVUpdateListener()
|
||||
updateListener.cancelJob(applicationContext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private fun checkShortcuts() {
|
||||
val appIconColor = config.appIconColor
|
||||
|
|
Loading…
Reference in New Issue