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.)
This commit is contained in:
Joe Steele 2014-07-30 10:52:01 -04:00
parent 346d903ec3
commit c5085be2ca
1 changed files with 6 additions and 0 deletions

View File

@ -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