Update unread counts and default sender Id in AccountFolderList after folder loding messages

BUG: 2072360
This commit is contained in:
satok 2009-09-28 19:50:38 +09:00
parent fff989df75
commit 473a5e5c66

View File

@ -213,12 +213,7 @@ public class AccountFolderList extends ListActivity
Controller.getInstance(getApplication()).addResultCallback(mControllerCallback);
if (mLoadAccountsTask != null &&
mLoadAccountsTask.getStatus() != LoadAccountsTask.Status.FINISHED) {
mLoadAccountsTask.cancel(true);
}
mLoadAccountsTask = (LoadAccountsTask) new LoadAccountsTask().execute();
updateAccounts();
// TODO: What updates do we need to auto-trigger, now that we have mailboxes in view?
}
@ -364,6 +359,14 @@ public class AccountFolderList extends ListActivity
}
}
private void updateAccounts() {
if (mLoadAccountsTask != null &&
mLoadAccountsTask.getStatus() != LoadAccountsTask.Status.FINISHED) {
mLoadAccountsTask.cancel(true);
}
mLoadAccountsTask = (LoadAccountsTask) new LoadAccountsTask().execute();
}
private void onAddNewAccount() {
AccountSetupBasics.actionNewAccount(this);
}
@ -446,6 +449,8 @@ public class AccountFolderList extends ListActivity
AccountSetupBasics.actionNewAccount(AccountFolderList.this);
finish();
}
// Update unread counts and the default sender Id
updateAccounts();
}
})
.setNegativeButton(R.string.cancel_action, new DialogInterface.OnClickListener() {
@ -619,6 +624,9 @@ public class AccountFolderList extends ListActivity
if (result != null || progress == 100) {
Email.updateMailboxRefreshTime(mailboxKey);
}
if (progress == 100) {
updateAccounts();
}
updateProgress(result, progress);
}