From 665b19e779cec4685c4d540abad4b03e1027cf97 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 9 Sep 2012 10:41:39 -0700 Subject: [PATCH] Don't reset user's port number in settings * Spinner onItemSelected is called prior to user input; this reverts the port to the security-based default Change-Id: I1cb67e519e9305ef2384b5f5f305bff1e950e7c4 --- .../setup/AccountSetupOutgoingFragment.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountSetupOutgoingFragment.java b/src/com/android/email/activity/setup/AccountSetupOutgoingFragment.java index 7564dcf7a..410aaebb9 100644 --- a/src/com/android/email/activity/setup/AccountSetupOutgoingFragment.java +++ b/src/com/android/email/activity/setup/AccountSetupOutgoingFragment.java @@ -127,13 +127,19 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment // Updates the port when the user changes the security type. This allows // us to show a reasonable default which the user can change. - mSecurityTypeView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { - public void onItemSelected(AdapterView arg0, View arg1, int arg2, long arg3) { - updatePortFromSecurityType(); - } + mSecurityTypeView.post(new Runnable() { + public void run() { + mSecurityTypeView.setOnItemSelectedListener( + new AdapterView.OnItemSelectedListener() { + public void onItemSelected(AdapterView arg0, View arg1, int arg2, + long arg3) { + updatePortFromSecurityType(); + } - public void onNothingSelected(AdapterView arg0) { } - }); + public void onNothingSelected(AdapterView arg0) { + } + }); + }}); // Calls validateFields() which enables or disables the Next button TextWatcher validationTextWatcher = new TextWatcher() {