From 09aae75f4e37c3197c6f8d3f046b15c71534d1f0 Mon Sep 17 00:00:00 2001 From: Andy Stadler Date: Thu, 27 Jan 2011 00:02:44 -0800 Subject: [PATCH] Fix account list after deleting accounts * After deleting an account, we need to actually update the list of known accounts - it's not sufficient to simply rebuild the headers with one account marked deleted. * Also remove a couple of obsolete TODO's Bug: 3382965 Change-Id: I1aa6d88f869f0192b564b538817381efdc5fffe0 --- src/com/android/email/activity/setup/AccountSettingsXL.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountSettingsXL.java b/src/com/android/email/activity/setup/AccountSettingsXL.java index b92de8c89..4a0595af5 100644 --- a/src/com/android/email/activity/setup/AccountSettingsXL.java +++ b/src/com/android/email/activity/setup/AccountSettingsXL.java @@ -59,7 +59,6 @@ import java.util.List; * DebugFragment * * TODO: In Account settings in Phone UI, change title - * TODO: Rework all remaining calls to DB from UI thread * TODO: Delete account - on single-pane view (phone UX) the account list doesn't update properly * TODO: Handle dynamic changes to the account list (exit if necessary). It probably makes * sense to use a loader for the accounts list, because it would provide better support for @@ -571,7 +570,6 @@ public class AccountSettingsXL extends PreferenceActivity { /** * Dispatch to edit incoming settings. * - * TODO: Cache the store lookup earlier, in an AsyncTask, to avoid this DB access * TODO: Make things less hardwired */ public void onIncomingSettings(Account account) { @@ -600,7 +598,6 @@ public class AccountSettingsXL extends PreferenceActivity { /** * Dispatch to edit outgoing settings. * - * TODO: Cache the store lookup earlier, in an AsyncTask, to avoid this DB access * TODO: Make things less hardwired */ public void onOutgoingSettings(Account account) { @@ -640,7 +637,7 @@ public class AccountSettingsXL extends PreferenceActivity { Header prefsHeader = getAppPreferencesHeader(); this.switchToHeader(prefsHeader.fragment, prefsHeader.fragmentArguments); mDeletingAccountId = account.mId; - invalidateHeaders(); + updateAccounts(); } else { // We should only be calling this while showing AccountSettingsFragment, // so a finish() should bring us back to headers. No point hiding the deleted account.