From 0275a8558dfc045da9a7d245810e940dabf56021 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 24 Jul 2017 18:37:13 +0800 Subject: [PATCH] Fix locale settings duplicate --- app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java index ca2639f17..8016b7539 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java @@ -127,6 +127,7 @@ public class SettingsActivity extends Activity { private ListPreference setLocalePreference(ListPreference lp) { if (lp == null) { lp = new ListPreference(getActivity()); + generalCatagory.addPreference(lp); } CharSequence[] entries = new CharSequence[magiskManager.locales.size() + 1]; CharSequence[] entryValues = new CharSequence[magiskManager.locales.size() + 1]; @@ -255,12 +256,11 @@ public class SettingsActivity extends Activity { @Override public void onTrigger(CallbackEvent event) { - ListPreference language = setLocalePreference(null); + ListPreference language = setLocalePreference((ListPreference) findPreference("locale")); language.setOnPreferenceClickListener((pref) -> { setLocalePreference((ListPreference) pref); return false; }); - generalCatagory.addPreference(language); } @Override