Check if the useAndroidSync preference exists before changing it

(Hopefully) fixes #197
This commit is contained in:
Jakob Nixdorf 2018-10-15 16:19:02 +02:00
parent 33e0070950
commit c6c6cce208
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC

View file

@ -134,10 +134,13 @@ public class SettingsActivity extends BaseActivity
} }
settings.setAndroidBackupServiceEnabled(false); settings.setAndroidBackupServiceEnabled(false);
fragment.useAndroidSync.setEnabled(false); if (fragment.useAndroidSync != null) {
fragment.useAndroidSync.setChecked(false); fragment.useAndroidSync.setEnabled(false);
fragment.useAndroidSync.setChecked(false);
}
} else { } else {
fragment.useAndroidSync.setEnabled(true); if (fragment.useAndroidSync != null)
fragment.useAndroidSync.setEnabled(true);
} }
} }
} }