From 3d13f25f87c4010992ef61c29a4ae00ed8c0dc5e Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 27 Nov 2015 15:34:37 -0800 Subject: Fix weird behavior with removing server in middle of list --- .../github/daneren2005/dsub/fragments/SettingsFragment.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java index e288b7cb..58a5d299 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java @@ -415,11 +415,14 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared } } + for (ServerSettings ss : serverSettings.values()) { + ss.update(); + } + } + public void checkForRemoved() { for (ServerSettings ss : serverSettings.values()) { if(!ss.update()) { - if(serversCategory != null) { - serversCategory.removePreference(ss.getScreen()); - } + serversCategory.removePreference(ss.getScreen()); } } } @@ -575,7 +578,7 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared SubsonicFragment parentFragment = context.getCurrentFragment(); if(parentFragment instanceof SettingsFragment) { SettingsFragment serverSelectionFragment = (SettingsFragment) parentFragment; - serverSelectionFragment.update(); + serverSelectionFragment.checkForRemoved(); } } }); -- cgit v1.2.3