Factor showAllAppsDialog
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index fbb1e5f..ef21c61 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1505,7 +1505,7 @@
 
             final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
             if (allApps) {
-                showDialog(DIALOG_ALL_APPS);
+                showAllAppsDialog();
             }
 
             mSavedState = null;
@@ -1586,7 +1586,7 @@
             if (mAllAppsDialog.isOpen) {
                 // TODO how can we be here?
             } else {
-                showDialog(DIALOG_ALL_APPS);
+                showAllAppsDialog();
             }
         }
     }
@@ -1772,7 +1772,6 @@
     protected void onPrepareDialog(int id, Dialog dialog) {
         switch (id) {
             case DIALOG_ALL_APPS:
-                mAllAppsDialog.isOpen = true;
                 break;
             case DIALOG_CREATE_SHORTCUT:
                 break;
@@ -1787,6 +1786,11 @@
         }
     }
 
+    void showAllAppsDialog() {
+        mAllAppsDialog.isOpen = true;
+        showDialog(DIALOG_ALL_APPS);
+    }
+
     void showRenameDialog(FolderInfo info) {
         mFolderInfo = info;
         mWaitingForResult = true;