1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Move initializeViewListeners() to onPostCreate()

Per comments in PR #474

https://github.com/k9mail/k-9/pull/474#commitcomment-7417262
This commit is contained in:
Joe Steele 2014-08-18 18:15:17 -04:00
parent f7fb0cca41
commit b39f9b95f1
3 changed files with 13 additions and 17 deletions

View File

@ -86,11 +86,6 @@ public class AccountSetupBasics extends K9Activity
mNextButton.setOnClickListener(this);
mManualSetupButton.setOnClickListener(this);
if (savedInstanceState == null) {
initializeViewListeners();
validateFields();
}
}
private void initializeViewListeners() {
@ -129,6 +124,12 @@ public class AccountSetupBasics extends K9Activity
updateViewVisibility(mClientCertificateCheckBox.isChecked());
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
/*
* We wait until now to initialize the listeners because we didn't want
* the OnCheckedChangeListener active while the

View File

@ -295,11 +295,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
mCurrentPortViewSetting = mPortView.getText().toString();
mSubscribedFoldersOnly.setChecked(mAccount.subscribedFoldersOnly());
if (savedInstanceState == null) {
initializeViewListeners();
validateFields();
}
} catch (Exception e) {
failure(e);
}
@ -383,8 +378,8 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
/*
* We didn't want the listeners active while the state was being restored

View File

@ -191,11 +191,6 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
updatePortFromSecurityType();
}
mCurrentPortViewSetting = mPortView.getText().toString();
if (savedInstanceState == null) {
initializeViewListeners();
validateFields();
}
} catch (Exception e) {
/*
* We should always be able to parse our own settings.
@ -316,6 +311,11 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
} else {
mRequireLoginSettingsView.setVisibility(View.GONE);
}
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
/*
* We didn't want the listeners active while the state was being restored