From adf6cbed878cd83d8bd6d66d74b2521dda9e8b10 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Tue, 28 Jan 2014 11:16:55 -0800 Subject: [PATCH] Move account force-creation to onResume() Otherwise the fragment we query for the values isn't fully created yet. b/12762185 Change-Id: I39ffa578e4bd6f6b5080112fa3cc617bbecbe158 --- .../email/activity/setup/AccountSetupFinal.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/android/email/activity/setup/AccountSetupFinal.java b/src/com/android/email/activity/setup/AccountSetupFinal.java index 447c95192..41f3d544f 100644 --- a/src/com/android/email/activity/setup/AccountSetupFinal.java +++ b/src/com/android/email/activity/setup/AccountSetupFinal.java @@ -63,6 +63,7 @@ public class AccountSetupFinal extends AccountSetupActivity implements View.OnCl private int mState = STATE_OPTIONS; private boolean mIsProcessing = false; + private boolean mForceCreate = false; private Button mNextButton; @@ -96,6 +97,17 @@ public class AccountSetupFinal extends AccountSetupActivity implements View.OnCl && mSetupData.getFlowMode() == SetupDataFragment.FLOW_MODE_FORCE_CREATE) { // If we are just visiting here to fill in details, exit immediately getFragmentManager().executePendingTransactions(); + mForceCreate = true; + } + } + + @Override + protected void onResume() { + super.onResume(); + if (mForceCreate) { + mForceCreate = false; + // We need to do this after onCreate so that we can ensure that the fragment is fully + // created before querying it. initiateAccountCreation(); } }