aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-11-27 15:34:37 -0800
committerScott Jackson <daneren2005@gmail.com>2015-11-27 15:34:37 -0800
commit3d13f25f87c4010992ef61c29a4ae00ed8c0dc5e (patch)
tree57c0670887cce3def5dfad1de33bdb745bbeddbc /app/src
parent5071050e612f940d6b97bcfaa218f361f69ccfa4 (diff)
downloaddsub-3d13f25f87c4010992ef61c29a4ae00ed8c0dc5e.tar.gz
dsub-3d13f25f87c4010992ef61c29a4ae00ed8c0dc5e.tar.bz2
dsub-3d13f25f87c4010992ef61c29a4ae00ed8c0dc5e.zip
Fix weird behavior with removing server in middle of list
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java11
1 files changed, 7 insertions, 4 deletions
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
@@ -416,10 +416,13 @@ 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();
}
}
});