From c073cfc9be146553403114e1d1957f0ad0b69399 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 8 Sep 2020 21:25:19 +0900 Subject: [PATCH] Fix logged in check in SettingsPreferencesFragment --- .../settings/SettingsPreferencesFragment.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java index abea091d..444c33fc 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java @@ -41,13 +41,13 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { public void onCreate(@Nullable final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); - final String cookie = settingsHelper.getString(Constants.COOKIE); - isLoggedIn = !Utils.isEmpty(cookie) && Utils.getUserIdFromCookie(cookie) != null; + } @Override void setupPreferenceScreen(final PreferenceScreen screen) { - + final String cookie = settingsHelper.getString(Constants.COOKIE); + isLoggedIn = !Utils.isEmpty(cookie) && Utils.getUserIdFromCookie(cookie) != null; final PreferenceCategory generalCategory = new PreferenceCategory(requireContext()); screen.addPreference(generalCategory); generalCategory.setTitle(getString(R.string.pref_category_general)); @@ -141,10 +141,6 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { preference.setEntries(R.array.main_nav_ids_values); preference.setEntryValues(values); preference.setIconSpaceReserved(false); - preference.setOnPreferenceChangeListener((preference1, newValue) -> { - shouldRecreate(); - return true; - }); return preference; }