Remove partially constructed accounts on resume
Resuming account setup activity when the account has been partially constructed (the setup has not been finished) resulted in having unsaved account with ID = -1 in the accounts list. The application would then on resume proceed to messages list but there won't be any folders as the setup has been aborted. The fix clears the list of accounts on resume and create so that the application properly reacts to the event of no setup accounts. Fixes #3717.
This commit is contained in:
parent
f168985b0b
commit
54d71ac54a
1 changed files with 6 additions and 2 deletions
|
@ -373,7 +373,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||
createSpecialAccounts();
|
||||
}
|
||||
|
||||
List<Account> accounts = Preferences.getPreferences(this).getAccounts();
|
||||
Preferences preferences = Preferences.getPreferences(this);
|
||||
preferences.loadAccounts();
|
||||
List<Account> accounts = preferences.getAccounts();
|
||||
Intent intent = getIntent();
|
||||
//onNewIntent(intent);
|
||||
|
||||
|
@ -538,8 +540,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||
|
||||
|
||||
private void refresh() {
|
||||
Preferences preferences = Preferences.getPreferences(this);
|
||||
preferences.loadAccounts();
|
||||
accounts.clear();
|
||||
accounts.addAll(Preferences.getPreferences(this).getAccounts());
|
||||
accounts.addAll(preferences.getAccounts());
|
||||
|
||||
// see if we should show the welcome message
|
||||
// if (accounts.length < 1) {
|
||||
|
|
Loading…
Reference in a new issue