diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/AliasConfig.java b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/AliasConfig.java index c7a2e5cc..38e9d46e 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/AliasConfig.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/AliasConfig.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -131,7 +132,7 @@ private void setRemote() { } RemoteItem.prepareDisplay(context, remotes); - remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); + Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); String[] options = new String[remotes.size()]; int i = 0; for (RemoteItem remote : remotes) { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CacheConfig.java b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CacheConfig.java index c5725223..8ea2c7e8 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CacheConfig.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CacheConfig.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import ca.pkay.rcloneexplorer.Dialogs.NumberPickerDialog; @@ -286,7 +287,7 @@ private void setRemote() { return; } RemoteItem.prepareDisplay(context, remotes); - remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); + Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); String[] options = new String[remotes.size()]; int i = 0; for (RemoteItem remote : remotes) { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CryptConfig.java b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CryptConfig.java index 3ab3c98a..8457938a 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CryptConfig.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/CryptConfig.java @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import ca.pkay.rcloneexplorer.Dialogs.PasswordGeneratorDialog; @@ -289,7 +290,7 @@ private void setRemote() { } RemoteItem.prepareDisplay(context, remotes); - remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); + Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); String[] options = new String[remotes.size()]; int i = 0; for (RemoteItem remote : remotes) { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/UnionConfig.java b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/UnionConfig.java index 2697819d..fc7ef519 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/UnionConfig.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/UnionConfig.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; public class UnionConfig extends Fragment implements RemoteDestinationDialog.OnDestinationSelectedListener { @@ -122,7 +123,7 @@ private void addRemote() { } RemoteItem.prepareDisplay(context, configuredRemotes); - configuredRemotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); + Collections.sort(configuredRemotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); String[] options = new String[configuredRemotes.size()]; int i = 0; for (RemoteItem remote : configuredRemotes) { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/Settings/GeneralSettingsFragment.java b/app/src/main/java/ca/pkay/rcloneexplorer/Settings/GeneralSettingsFragment.java index 8e6ed827..f2c7b29c 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/Settings/GeneralSettingsFragment.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/Settings/GeneralSettingsFragment.java @@ -216,7 +216,7 @@ private void showAppShortcutDialog() { Rclone rclone = new Rclone(context); final ArrayList remotes = new ArrayList<>(rclone.getRemotes()); RemoteItem.prepareDisplay(context, remotes); - remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); + Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName())); final CharSequence[] options = new CharSequence[remotes.size()]; int i = 0; for (RemoteItem remoteItem : remotes) {