Skip to content

Commit

Permalink
Merge pull request #1511 from moneymanagerex/v19
Browse files Browse the repository at this point in the history
Opt users out of tracking
  • Loading branch information
guanlisheng authored Jan 11, 2024
2 parents e218eb5 + b93674c commit 45d5942
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 45d5942

Please sign in to comment.