From b93674c9ce38eb05d06fa0e2dc7f86a3e52a5785 Mon Sep 17 00:00:00 2001 From: Lisheng Guan Date: Thu, 11 Jan 2024 23:34:30 +0800 Subject: [PATCH] Opt users out of tracking --- .../money/manager/ex/settings/GeneralSettingsFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/settings/GeneralSettingsFragment.java b/app/src/main/java/com/money/manager/ex/settings/GeneralSettingsFragment.java index a36de877fd..17dacde8fc 100644 --- a/app/src/main/java/com/money/manager/ex/settings/GeneralSettingsFragment.java +++ b/app/src/main/java/com/money/manager/ex/settings/GeneralSettingsFragment.java @@ -117,9 +117,9 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } // send anonymous usage data - final SwitchPreferenceCompat spreference = (SwitchPreferenceCompat) findPreference(getString(R.string.pref_anonymous_usage)); - if (spreference == null) { - spreference.setOnPreferenceChangeListener((preference, newValue) -> { + final SwitchPreferenceCompat sPreference = (SwitchPreferenceCompat) findPreference(getString(R.string.pref_anonymous_usage)); + if (sPreference != null) { + sPreference.setOnPreferenceChangeListener((preference, newValue) -> { // Handle the switch state change boolean isChecked = (Boolean) newValue; MmexApplication.getAmplitude().getConfiguration().setOptOut(isChecked);