From c5085be2cab7989ab79d70ce2f1211674783205d Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Wed, 30 Jul 2014 10:52:01 -0400 Subject: [PATCH] Restore view visibility based on restored CheckBox state The problem can be observed if, when modifying the outgoing server settings, you change the state of the mRequireLoginView check box, then change the screen orientation. This is necessary because the OnCheckChanged listener (which normally updates the view visibility) is not yet set. (The listeners are set up after view initialization so that they only fire on user input.) --- src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 0b28ee44a..a9c32fe09 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -311,6 +311,12 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); + if (mRequireLoginView.isChecked()) { + mRequireLoginSettingsView.setVisibility(View.VISIBLE); + } else { + mRequireLoginSettingsView.setVisibility(View.GONE); + } + /* * We didn't want the listeners active while the state was being restored * because they could overwrite the restored port with a default port when