From 4822b266ef6b50f3d6d6aaf100c399db35d62df1 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Wed, 16 Apr 2014 10:31:45 -0700 Subject: [PATCH] Don't re-add fragment if it's already been added b/14088388 Change-Id: Ie86220f2ab3bf6286ba206248b79291a51b04fad --- .../email/activity/setup/AccountCredentials.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountCredentials.java b/src/com/android/email/activity/setup/AccountCredentials.java index 20d7b9112..a58f18362 100644 --- a/src/com/android/email/activity/setup/AccountCredentials.java +++ b/src/com/android/email/activity/setup/AccountCredentials.java @@ -32,13 +32,15 @@ public class AccountCredentials extends Activity final String emailAddress = getIntent().getStringExtra(EXTRA_EMAIL); final String protocol = getIntent().getStringExtra(EXTRA_PROTOCOL); - final AccountSetupCredentialsFragment f = - AccountSetupCredentialsFragment.newInstance(emailAddress, protocol, - null /* clientCert */, false /* passwordFailed */, true /* standalone */); - getFragmentManager().beginTransaction() - .add(R.id.account_credentials_fragment_container, f, CREDENTIALS_FRAGMENT_TAG) - .commit(); - + if (savedInstanceState == null) { + final AccountSetupCredentialsFragment f = + AccountSetupCredentialsFragment.newInstance(emailAddress, protocol, + null /* clientCert */, false /* passwordFailed */, + true /* standalone */); + getFragmentManager().beginTransaction() + .add(R.id.account_credentials_fragment_container, f, CREDENTIALS_FRAGMENT_TAG) + .commit(); + } // Assume canceled until we find out otherwise. setResult(RESULT_CANCELED); }