am 86241e23: am b0b61fa2: Merge change I74466dcc into eclair

Merge commit '86241e23e4b4c96e100c394c5117b02d12eadf18'

* commit '86241e23e4b4c96e100c394c5117b02d12eadf18':
  Update unread counts and default sender Id in AccountFolderList after folder loding messages
This commit is contained in:
satok 2009-10-01 11:09:25 -07:00 committed by Android Git Automerger
commit 472ee7f778

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);
}