fixed device rotation in settings activity

This commit is contained in:
Daniel Gultsch 2018-03-16 12:58:43 +01:00
parent 182b4c08b5
commit 9765f26de0
2 changed files with 5 additions and 2 deletions

View File

@ -113,7 +113,6 @@ public class SettingsActivity extends XmppActivity implements
CharSequence[] entries = new CharSequence[choices.length]; CharSequence[] entries = new CharSequence[choices.length];
CharSequence[] entryValues = new CharSequence[choices.length]; CharSequence[] entryValues = new CharSequence[choices.length];
for (int i = 0; i < choices.length; ++i) { for (int i = 0; i < choices.length; ++i) {
Log.d(Config.LOGTAG,"resolving choice "+choices[i]);
entryValues[i] = String.valueOf(choices[i]); entryValues[i] = String.valueOf(choices[i]);
if (choices[i] == 0) { if (choices[i] == 0) {
entries[i] = getString(R.string.never); entries[i] = getString(R.string.never);
@ -156,7 +155,7 @@ public class SettingsActivity extends XmppActivity implements
displayToast(getString(R.string.toast_no_trusted_certs)); displayToast(getString(R.string.toast_no_trusted_certs));
return true; return true;
} }
final ArrayList selectedItems = new ArrayList<>(); final ArrayList<Integer> selectedItems = new ArrayList<>();
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this);
dialogBuilder.setTitle(getResources().getString(R.string.dialog_manage_certs_title)); dialogBuilder.setTitle(getResources().getString(R.string.dialog_manage_certs_title));
dialogBuilder.setMultiChoiceItems(aliases.toArray(new CharSequence[aliases.size()]), null, dialogBuilder.setMultiChoiceItems(aliases.toArray(new CharSequence[aliases.size()]), null,

View File

@ -39,10 +39,14 @@ public class SettingsFragment extends PreferenceFragment {
} }
public void setActivityIntent(final Intent intent) { public void setActivityIntent(final Intent intent) {
boolean wasEmpty = TextUtils.isEmpty(page);
if (intent != null) { if (intent != null) {
if (Intent.ACTION_VIEW.equals(intent.getAction())) { if (Intent.ACTION_VIEW.equals(intent.getAction())) {
if (intent.getExtras() != null) { if (intent.getExtras() != null) {
this.page = intent.getExtras().getString("page"); this.page = intent.getExtras().getString("page");
if (wasEmpty) {
openPreferenceScreen(page);
}
} }
} }
} }