federicoiosue / Omni-Notes

Open source note-taking application for Android
https://omninotes.app
GNU General Public License v3.0
2.68k stars 1.11k forks source link

"Erase all data" does not clear sharedpreferences #790

Closed tappdesign closed 3 years ago

tappdesign commented 3 years ago

After click --> settings | Data | Erase all data are all data erased except settings in sharedpreferences (Android 8.0)

Issue could be possibly solved by changing from prefs.edit().clear().apply(); to prefs.edit().clear().commit();

in SettingsFragment.java

 Preference resetData = findPreference("reset_all_data");
    if (resetData != null) {
      resetData.setOnPreferenceClickListener(arg0 -> {

        new MaterialDialog.Builder(getContext())
            .content(R.string.reset_all_data_confirmation)
            .positiveText(R.string.confirm)
            .onPositive((dialog, which) -> {
              prefs.edit().clear().apply();
.....
federicoiosue commented 3 years ago

Actually I completely forgot to do that!! Thanks for reaching me with the issue!