diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderSettingsFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderSettingsFragment.java index 17d1fa98..f10019d1 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderSettingsFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderSettingsFragment.java @@ -151,6 +151,8 @@ public class FolderSettingsFragment extends PreferenceFragment List devicesList = mSyncthingService.getApi().getDevices(); for (RestApi.Device n : devicesList) { ExtendedCheckBoxPreference cbp = new ExtendedCheckBoxPreference(getActivity(), n); + // Calling addPreference later causes it to change the checked state. + mDevices.addPreference(cbp); cbp.setTitle(n.Name); cbp.setKey(KEY_NODE_SHARED); cbp.setOnPreferenceChangeListener(FolderSettingsFragment.this); @@ -160,7 +162,6 @@ public class FolderSettingsFragment extends PreferenceFragment cbp.setChecked(true); } } - mDevices.addPreference(cbp); } mVersioning.setChecked(mFolder.Versioning instanceof RestApi.SimpleVersioning); if (mVersioning.isChecked()) { diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java index b72928eb..976242e7 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java @@ -482,7 +482,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, JSONObject n = devices.getJSONObject(j); r.DeviceIds.add(n.getString("DeviceID")); } - r.DeviceIds.add(mLocalDeviceId); r.ReadOnly = json.getBoolean("ReadOnly"); r.RescanIntervalS = json.getInt("RescanIntervalS");