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[] 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<Integer> 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,

View file

@ -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);
}
}
}
}