mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
stop caldav update listener if CalDAV sync is turned off
This commit is contained in:
@@ -163,6 +163,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
if (!isChangingConfigurations) {
|
if (!isChangingConfigurations) {
|
||||||
EventsDatabase.destroyInstance()
|
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")
|
@SuppressLint("NewApi")
|
||||||
private fun checkShortcuts() {
|
private fun checkShortcuts() {
|
||||||
val appIconColor = config.appIconColor
|
val appIconColor = config.appIconColor
|
||||||
|
Reference in New Issue
Block a user