diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index be3662f..df7e006 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -134,6 +134,7 @@
     private static final String SAVE_KEY_SEARCH_QUERY = ":settings:search_query";
     private static final String SAVE_KEY_SHOW_HOME_AS_UP = ":settings:show_home_as_up";
     private static final String SAVE_KEY_SHOW_SEARCH = ":settings:show_search";
+    private static final String SAVE_KEY_HOME_ACTIVITIES_COUNT = ":settings:home_activities_count";
 
     /**
      * When starting this activity, the invoking Intent can contain this extra
@@ -349,6 +350,7 @@
     };
 
     private boolean mNeedToRevertToInitialFragment = false;
+    private int mHomeActivitiesCount = 1;
 
     public SwitchBar getSwitchBar() {
         return mSwitchBar;
@@ -526,6 +528,8 @@
 
             mDisplayHomeAsUpEnabled = savedState.getBoolean(SAVE_KEY_SHOW_HOME_AS_UP);
             mDisplaySearch = savedState.getBoolean(SAVE_KEY_SHOW_SEARCH);
+            mHomeActivitiesCount = savedState.getInt(SAVE_KEY_HOME_ACTIVITIES_COUNT,
+                    1 /* one home activity by default */);
         } else {
             if (!mIsShowingDashboard) {
                 // Search is shown we are launched thru a Settings "shortcut". UP will be shown
@@ -613,6 +617,14 @@
                 }
             }
         }
+
+        mHomeActivitiesCount = getHomeActivitiesCount();
+    }
+
+    private int getHomeActivitiesCount() {
+        final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
+        getPackageManager().getHomeActivities(homeApps);
+        return homeApps.size();
     }
 
     private void setTitleFromIntent(Intent intent) {
@@ -688,12 +700,21 @@
             String query = (mSearchView != null) ? mSearchView.getQuery().toString() : EMPTY_QUERY;
             outState.putString(SAVE_KEY_SEARCH_QUERY, query);
         }
+
+        outState.putInt(SAVE_KEY_HOME_ACTIVITIES_COUNT, mHomeActivitiesCount);
     }
 
     @Override
     public void onResume() {
         super.onResume();
 
+        final int newHomeActivityCount = getHomeActivitiesCount();
+        if (newHomeActivityCount != mHomeActivitiesCount) {
+            mHomeActivitiesCount = newHomeActivityCount;
+            setNeedToRebuildCategories(true);
+            invalidateCategories();
+        }
+
         mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
             @Override
             public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
@@ -1145,9 +1166,7 @@
         }
 
         try {
-            final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
-            getPackageManager().getHomeActivities(homeApps);
-            if (homeApps.size() < 2) {
+            if (mHomeActivitiesCount < 2) {
                 // When there's only one available home app, omit this settings
                 // category entirely at the top level UI.  If the user just
                 // uninstalled the penultimate home app candidiate, we also
