diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2017-01-01 10:46:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-01 10:46:20 +0100 |
commit | a020b7eb85280831461de9cee46b0db6b4ef79a7 (patch) | |
tree | 09152f9b68dbe8ab80d999d3f417f1798607353e | |
parent | 1a58d6f2a813a3d9c4c29eb10a76349aee6c9cf1 (diff) | |
parent | f6ee58ba2758b505a63f08b2e43db59fb6655cac (diff) | |
download | AntennaPod-a020b7eb85280831461de9cee46b0db6b4ef79a7.zip |
Merge pull request #2226 from andrewgaul/sort-wifi
Sort wifi names in automatic download preferences
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 818b3a625..7f1d3075f 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -43,6 +43,8 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; import java.util.GregorianCalendar; import java.util.List; import java.util.concurrent.TimeUnit; @@ -748,6 +750,12 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc List<WifiConfiguration> networks = wifiservice.getConfiguredNetworks(); if (networks != null) { + Collections.sort(networks, new Comparator<WifiConfiguration>() { + @Override + public int compare(WifiConfiguration x, WifiConfiguration y) { + return x.SSID.compareTo(y.SSID); + } + }); selectedNetworks = new CheckBoxPreference[networks.size()]; List<String> prefValues = Arrays.asList(UserPreferences .getAutodownloadSelectedNetworks()); |