diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index 8d0aad7aa..34891f13b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -90,7 +90,7 @@ class MainActivity : SimpleActivity(), NavigationListener { config.googleSync = false } - if (config.syncAccountName.isNotEmpty()) { + if (config.syncAccountName.isNotEmpty() && config.googleSync) { FetchGoogleEventsTask(this, googleSyncListener).execute() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt index 760d938cc..911cadddf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -134,6 +134,8 @@ class SettingsActivity : SimpleActivity() { if (settings_google_sync.isChecked) { tryEnablingSync() + } else { + disableGoogleSync() } } @@ -346,8 +348,9 @@ class SettingsActivity : SimpleActivity() { } private fun disableGoogleSync() { - settings_google_sync.toggle() + settings_google_sync.isChecked = false config.googleSync = false + config.syncAccountName = "" } override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) {