From 2dcf6083f77ea8abc200dc87eed22b8bbb45fd07 Mon Sep 17 00:00:00 2001 From: Birdson_Chen Date: Fri, 26 Jul 2013 16:48:28 +0800 Subject: [PATCH] Fix "Add Network" show last selected WiFi AP Dialog When user taps Wi-Fi add network button, the pop-up dialog is not empty (it shows last selected WiFi AP Dialog). The above is observed after the following steps: - Launch Settings application - Turn on Wi-Fi - Select any Wi-Fi Access Point which is not connected previously and change to portrait mode - Press Cancel from the pop-up and select Add Network icon in menu Because the "Rotation" operation will cause WifiDialog re-creating and the current settings of selected Wi-Fi Access Point is saved before WifiDialog destroyed. Then, the saved Wi-Fi Access Point is displayed when user tap on "Add Network". It need to clear the saved Wi-Fi Access Point when WifiDialog re-creating. Change-Id: I3e93943e5bee405329e309c3ec88a35ee9cafc43 --- src/com/android/settings/wifi/WifiSettings.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index cb35e10c138..24f56c1b4a9 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -646,6 +646,8 @@ public class WifiSettings extends SettingsPreferenceFragment ap = new AccessPoint(getActivity(), mAccessPointSavedState); // For repeated orientation changes mDlgAccessPoint = ap; + // Reset the saved access point data + mAccessPointSavedState = null; } } // If it's still null, fine, it's for Add Network