From 473a5e5c6692bf9c538e4d4b0f746306dd9dc2f2 Mon Sep 17 00:00:00 2001 From: satok Date: Mon, 28 Sep 2009 19:50:38 +0900 Subject: [PATCH] Update unread counts and default sender Id in AccountFolderList after folder loding messages BUG: 2072360 --- .../email/activity/AccountFolderList.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/com/android/email/activity/AccountFolderList.java b/src/com/android/email/activity/AccountFolderList.java index 1dfb955ac..62f60f011 100644 --- a/src/com/android/email/activity/AccountFolderList.java +++ b/src/com/android/email/activity/AccountFolderList.java @@ -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); }