Merge pull request #3730 from wiktor-k/remove-unsaved-accounts

Remove partially constructed accounts on resume
This commit is contained in:
Vincent Breitmoser 2018-11-21 10:28:58 +01:00 committed by GitHub
commit 8df62f136d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -373,7 +373,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
createSpecialAccounts(); createSpecialAccounts();
} }
List<Account> accounts = Preferences.getPreferences(this).getAccounts(); Preferences preferences = Preferences.getPreferences(this);
preferences.loadAccounts();
List<Account> accounts = preferences.getAccounts();
Intent intent = getIntent(); Intent intent = getIntent();
//onNewIntent(intent); //onNewIntent(intent);
@ -538,8 +540,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
private void refresh() { private void refresh() {
Preferences preferences = Preferences.getPreferences(this);
preferences.loadAccounts();
accounts.clear(); accounts.clear();
accounts.addAll(Preferences.getPreferences(this).getAccounts()); accounts.addAll(preferences.getAccounts());
// see if we should show the welcome message // see if we should show the welcome message
// if (accounts.length < 1) { // if (accounts.length < 1) {