From 0bfeb90e4163c0d9ed8d77f4f73b07aa477eef98 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Wed, 18 Sep 2013 11:56:47 -0700 Subject: [PATCH] Don't disable the back button when the account name fields are invalid b/10695553 Change-Id: I32df55594784e24263dede9b767786ccdc83662c --- src/com/android/email/activity/setup/AccountSetupNames.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/activity/setup/AccountSetupNames.java b/src/com/android/email/activity/setup/AccountSetupNames.java index c5bdabddd..b901fec46 100644 --- a/src/com/android/email/activity/setup/AccountSetupNames.java +++ b/src/com/android/email/activity/setup/AccountSetupNames.java @@ -57,6 +57,7 @@ public class AccountSetupNames extends AccountSetupActivity { private EditText mName; private Button mNextButton; private boolean mRequiresName = true; + private boolean mIsCompleting = false; public static void actionSetNames(Activity fromActivity, SetupData setupData) { ForwardingIntent intent = new ForwardingIntent(fromActivity, AccountSetupNames.class); @@ -182,7 +183,7 @@ public class AccountSetupNames extends AccountSetupActivity { */ @Override public void onBackPressed() { - if (mNextButton.isEnabled()) { + if (!mIsCompleting) { finishActivity(); } } @@ -207,6 +208,7 @@ public class AccountSetupNames extends AccountSetupActivity { */ private void onNext() { mNextButton.setEnabled(false); // Protect against double-tap. + mIsCompleting = true; // Update account object from UI final Account account = mSetupData.getAccount();