diff --git a/k9mail/src/main/java/com/fsck/k9/preferences/SettingsExporter.java b/k9mail/src/main/java/com/fsck/k9/preferences/SettingsExporter.java index af4593857..936ea19f7 100644 --- a/k9mail/src/main/java/com/fsck/k9/preferences/SettingsExporter.java +++ b/k9mail/src/main/java/com/fsck/k9/preferences/SettingsExporter.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -155,7 +156,7 @@ public class SettingsExporter { Set exportAccounts; if (accountUuids == null) { List accounts = preferences.getAccounts(); - exportAccounts = new HashSet<>(); + exportAccounts = new LinkedHashSet<>(); for (Account account : accounts) { exportAccounts.add(account.getUuid()); } diff --git a/k9mail/src/main/java/com/fsck/k9/preferences/SettingsImporter.java b/k9mail/src/main/java/com/fsck/k9/preferences/SettingsImporter.java index 109a0ce06..cef79918e 100644 --- a/k9mail/src/main/java/com/fsck/k9/preferences/SettingsImporter.java +++ b/k9mail/src/main/java/com/fsck/k9/preferences/SettingsImporter.java @@ -7,6 +7,7 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.UUID; @@ -804,7 +805,7 @@ public class SettingsImporter { String element = xpp.getName(); if (SettingsExporter.ACCOUNT_ELEMENT.equals(element)) { if (accounts == null) { - accounts = new HashMap<>(); + accounts = new LinkedHashMap<>(); } ImportedAccount account = parseAccount(xpp, accountUuids, overview);