diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6805224..26c7cc5 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -278,7 +278,6 @@
         <activity android:name="Settings$VpnSettingsActivity"
                 android:theme="@android:style/Theme.Holo"
                 android:label="@string/vpn_settings_activity_title"
-                android:configChanges="orientation|keyboardHidden"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 77f703c..17bf02d 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -182,6 +182,8 @@
                                         + DialogCreatable.class.getName());
                     }
                 }
+                // restore mDialogFragment in mParentFragment
+                ((SettingsPreferenceFragment) mParentFragment).mDialogFragment = this;
             }
             return ((DialogCreatable) mParentFragment).onCreateDialog(mDialogId);
         }
@@ -204,6 +206,16 @@
         public int getDialogId() {
             return mDialogId;
         }
+
+        @Override
+        public void onDetach() {
+            super.onDetach();
+
+            // in case the dialog is not explicitly removed by removeDialog()
+            if (((SettingsPreferenceFragment) mParentFragment).mDialogFragment == this) {
+                ((SettingsPreferenceFragment) mParentFragment).mDialogFragment = null;
+            }
+        }
     }
 
     protected boolean hasNextButton() {
diff --git a/src/com/android/settings/vpn/VpnSettings.java b/src/com/android/settings/vpn/VpnSettings.java
index 318a5bf..539a51e 100644
--- a/src/com/android/settings/vpn/VpnSettings.java
+++ b/src/com/android/settings/vpn/VpnSettings.java
@@ -86,6 +86,7 @@
 
     private static final String KEY_ACTIVE_PROFILE = "ActiveProfile";
     private static final String KEY_PROFILE_CONNECTING = "ProfileConnecting";
+    private static final String KEY_CONNECT_DIALOG_SHOWING = "ConnectDialogShowing";
 
     private static final int REQUEST_ADD_OR_EDIT_PROFILE = 1;
     static final int REQUEST_SELECT_VPN_TYPE = 2;
@@ -140,33 +141,6 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         addPreferencesFromResource(R.xml.vpn_settings);
-    }
-
-    @Override
-    public void onSaveInstanceState(Bundle savedInstanceState) {
-        if (mActiveProfile != null) {
-            savedInstanceState.putString(KEY_ACTIVE_PROFILE,
-                    mActiveProfile.getId());
-            savedInstanceState.putBoolean(KEY_PROFILE_CONNECTING,
-                    (mConnectingActor != null));
-        }
-        super.onSaveInstanceState(savedInstanceState);
-    }
-
-    private void restoreInstanceState(Bundle savedInstanceState) {
-        if (savedInstanceState == null) return;
-        String profileId = savedInstanceState.getString(KEY_ACTIVE_PROFILE);
-        if (profileId != null) {
-            mActiveProfile = getProfile(getProfileIndexFromId(profileId));
-            if (savedInstanceState.getBoolean(KEY_PROFILE_CONNECTING)) {
-                mConnectingActor = getActor(mActiveProfile);
-            }
-        }
-    }
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
 
         mVpnManager = new VpnManager(getActivity());
         // restore VpnProfile list and construct VpnPreference map
@@ -182,14 +156,44 @@
                     }
                 });
 
-        // for long-press gesture on a profile preference
-        registerForContextMenu(getListView());
-
         retrieveVpnListFromStorage();
         restoreInstanceState(savedInstanceState);
     }
 
     @Override
+    public void onSaveInstanceState(Bundle savedInstanceState) {
+        if (mActiveProfile != null) {
+            savedInstanceState.putString(KEY_ACTIVE_PROFILE,
+                    mActiveProfile.getId());
+            savedInstanceState.putBoolean(KEY_PROFILE_CONNECTING,
+                    (mConnectingActor != null));
+            savedInstanceState.putBoolean(KEY_CONNECT_DIALOG_SHOWING,
+                    mConnectDialogShowing);
+        }
+        super.onSaveInstanceState(savedInstanceState);
+    }
+
+    private void restoreInstanceState(Bundle savedInstanceState) {
+        if (savedInstanceState == null) return;
+        String profileId = savedInstanceState.getString(KEY_ACTIVE_PROFILE);
+        if (profileId != null) {
+            mActiveProfile = getProfile(getProfileIndexFromId(profileId));
+            if (savedInstanceState.getBoolean(KEY_PROFILE_CONNECTING)) {
+                mConnectingActor = getActor(mActiveProfile);
+            }
+            mConnectDialogShowing = savedInstanceState.getBoolean(KEY_CONNECT_DIALOG_SHOWING);
+        }
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+
+        // for long-press gesture on a profile preference
+        registerForContextMenu(getListView());
+    }
+
+    @Override
     public void onPause() {
         // ignore vpn connectivity event
         mVpnManager.unregisterConnectivityReceiver(mConnectivityReceiver);
@@ -205,8 +209,7 @@
         super.onResume();
         updatePreferenceMap();
 
-        if (DEBUG)
-            Log.d(TAG, "onResume");
+        if (DEBUG) Log.d(TAG, "onResume");
 
         // listen to vpn connectivity event
         mVpnManager.registerConnectivityReceiver(mConnectivityReceiver);
@@ -249,17 +252,7 @@
     }
 
     @Override
-    protected void showDialog(int dialogId) {
-        super.showDialog(dialogId);
-
-        if (dialogId == DIALOG_CONNECT) {
-            mConnectDialogShowing = true;
-            setOnDismissListener(new DialogInterface.OnDismissListener() {
-                public void onDismiss(DialogInterface dialog) {
-                    mConnectDialogShowing = false;
-                }
-            });
-        }
+    public Dialog onCreateDialog (int id) {
         setOnCancelListener(new DialogInterface.OnCancelListener() {
             public void onCancel(DialogInterface dialog) {
                 if (mActiveProfile != null) {
@@ -272,12 +265,15 @@
                 onIdle();
             }
         });
-    }
 
-    @Override
-    public Dialog onCreateDialog (int id) {
         switch (id) {
             case DIALOG_CONNECT:
+                mConnectDialogShowing = true;
+                setOnDismissListener(new DialogInterface.OnDismissListener() {
+                    public void onDismiss(DialogInterface dialog) {
+                        mConnectDialogShowing = false;
+                    }
+                });
                 return createConnectDialog();
 
             case DIALOG_SECRET_NOT_SET:
@@ -524,7 +520,6 @@
             String error = mConnectingActor.validateInputs(d);
             if (error == null) {
                 mConnectingActor.connect(d);
-                return;
             } else {
                 // show error dialog
                 final Activity activity = getActivity();
@@ -795,7 +790,6 @@
 
     private void changeState(VpnProfile p, VpnState state) {
         VpnState oldState = p.getState();
-        if (oldState == state) return;
         p.setState(state);
         mVpnPreferenceMap.get(p.getName()).setSummary(
                 getProfileSummaryString(p));
@@ -808,7 +802,9 @@
             break;
 
         case CONNECTING:
-            mConnectingActor = getActor(p);
+            if (mConnectingActor == null) {
+                mConnectingActor = getActor(p);
+            }
             // $FALL-THROUGH$
         case DISCONNECTING:
             mActiveProfile = p;
@@ -883,12 +879,12 @@
         mVpnPreferenceMap = new LinkedHashMap<String, VpnPreference>();
         mVpnListContainer.removeAll();
         for (VpnProfile p : sVpnProfileList) {
-            addPreferenceFor(p, false);
+            addPreferenceFor(p, true);
         }
         // reset the mActiveProfile if the profile has been removed from the
         // other instance.
         if ((mActiveProfile != null)
-                && mVpnPreferenceMap.containsKey(mActiveProfile.getName())) {
+                && !mVpnPreferenceMap.containsKey(mActiveProfile.getName())) {
             onIdle();
         }
     }
@@ -924,11 +920,6 @@
         for (VpnProfile p : sVpnProfileList) {
             changeState(p, mVpnManager.getState(p));
         }
-        // make preferences appear
-        for (VpnProfile p : sVpnProfileList) {
-            VpnPreference pref = mVpnPreferenceMap.get(p.getName());
-            mVpnListContainer.addPreference(pref);
-        }
     }
 
     // A sanity check. Returns true if the profile directory name and profile ID
