Save/restore certificate alias

pull/184/head
M66B 4 years ago
parent bda49eb55f
commit eede8c5bdc

@ -1398,6 +1398,7 @@ public class FragmentAccount extends FragmentBase {
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
outState.putInt("fair:provider", spProvider.getSelectedItemPosition()); outState.putInt("fair:provider", spProvider.getSelectedItemPosition());
outState.putString("fair:certificate", certificate);
outState.putString("fair:password", tilPassword.getEditText().getText().toString()); outState.putString("fair:password", tilPassword.getEditText().getText().toString());
outState.putInt("fair:advanced", grpAdvanced.getVisibility()); outState.putInt("fair:advanced", grpAdvanced.getVisibility());
outState.putInt("fair:auth", auth); outState.putInt("fair:auth", auth);
@ -1538,6 +1539,9 @@ public class FragmentAccount extends FragmentBase {
spProvider.setTag(p); spProvider.setTag(p);
spProvider.setSelection(p); spProvider.setSelection(p);
certificate = savedInstanceState.getString("fair:certificate");
tvCertificate.setText(certificate == null ? getString(R.string.title_optional) : certificate);
tilPassword.getEditText().setText(savedInstanceState.getString("fair:password")); tilPassword.getEditText().setText(savedInstanceState.getString("fair:password"));
grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced")); grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced"));
auth = savedInstanceState.getInt("fair:auth"); auth = savedInstanceState.getInt("fair:auth");

@ -1047,6 +1047,7 @@ public class FragmentIdentity extends FragmentBase {
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
outState.putInt("fair:account", spAccount.getSelectedItemPosition()); outState.putInt("fair:account", spAccount.getSelectedItemPosition());
outState.putInt("fair:provider", spProvider.getSelectedItemPosition()); outState.putInt("fair:provider", spProvider.getSelectedItemPosition());
outState.putString("fair:certificate", certificate);
outState.putString("fair:password", tilPassword.getEditText().getText().toString()); outState.putString("fair:password", tilPassword.getEditText().getText().toString());
outState.putInt("fair:advanced", grpAdvanced.getVisibility()); outState.putInt("fair:advanced", grpAdvanced.getVisibility());
outState.putInt("fair:auth", auth); outState.putInt("fair:auth", auth);
@ -1153,6 +1154,9 @@ public class FragmentIdentity extends FragmentBase {
} }
}.execute(FragmentIdentity.this, new Bundle(), "identity:count"); }.execute(FragmentIdentity.this, new Bundle(), "identity:count");
} else { } else {
certificate = savedInstanceState.getString("fair:certificate");
tvCertificate.setText(certificate == null ? getString(R.string.title_optional) : certificate);
tilPassword.getEditText().setText(savedInstanceState.getString("fair:password")); tilPassword.getEditText().setText(savedInstanceState.getString("fair:password"));
grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced")); grpAdvanced.setVisibility(savedInstanceState.getInt("fair:advanced"));
auth = savedInstanceState.getInt("fair:auth"); auth = savedInstanceState.getInt("fair:auth");

Loading…
Cancel
Save