From 9765f26de0174413ae9d48f0c99ef02d2884a119 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 16 Mar 2018 12:58:43 +0100 Subject: [PATCH] fixed device rotation in settings activity --- src/main/java/eu/siacs/conversations/ui/SettingsActivity.java | 3 +-- src/main/java/eu/siacs/conversations/ui/SettingsFragment.java | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index 3bae3a849..bc3f99e6c 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -113,7 +113,6 @@ public class SettingsActivity extends XmppActivity implements CharSequence[] entries = new CharSequence[choices.length]; CharSequence[] entryValues = new CharSequence[choices.length]; for (int i = 0; i < choices.length; ++i) { - Log.d(Config.LOGTAG,"resolving choice "+choices[i]); entryValues[i] = String.valueOf(choices[i]); if (choices[i] == 0) { entries[i] = getString(R.string.never); @@ -156,7 +155,7 @@ public class SettingsActivity extends XmppActivity implements displayToast(getString(R.string.toast_no_trusted_certs)); return true; } - final ArrayList selectedItems = new ArrayList<>(); + final ArrayList selectedItems = new ArrayList<>(); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this); dialogBuilder.setTitle(getResources().getString(R.string.dialog_manage_certs_title)); dialogBuilder.setMultiChoiceItems(aliases.toArray(new CharSequence[aliases.size()]), null, diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/SettingsFragment.java index 4638ee288..ace5b2f91 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsFragment.java @@ -39,10 +39,14 @@ public class SettingsFragment extends PreferenceFragment { } public void setActivityIntent(final Intent intent) { + boolean wasEmpty = TextUtils.isEmpty(page); if (intent != null) { if (Intent.ACTION_VIEW.equals(intent.getAction())) { if (intent.getExtras() != null) { this.page = intent.getExtras().getString("page"); + if (wasEmpty) { + openPreferenceScreen(page); + } } } }