fix provider list preference not saving correctly
This commit is contained in:
parent
85d4ca3f96
commit
2022cf3d6e
1 changed files with 5 additions and 8 deletions
|
@ -109,7 +109,7 @@ public class UserPreference extends AppCompatActivity {
|
||||||
|
|
||||||
findPreference("openpgp_provider_list").setOnPreferenceChangeListener((preference, o) -> {
|
findPreference("openpgp_provider_list").setOnPreferenceChangeListener((preference, o) -> {
|
||||||
callingActivity.mKey.setOpenPgpProvider((String) o);
|
callingActivity.mKey.setOpenPgpProvider((String) o);
|
||||||
return false;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
final Preference externalRepo = findPreference("pref_select_external");
|
final Preference externalRepo = findPreference("pref_select_external");
|
||||||
|
@ -119,13 +119,10 @@ public class UserPreference extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
Preference.OnPreferenceChangeListener resetRepo = new Preference.OnPreferenceChangeListener() {
|
Preference.OnPreferenceChangeListener resetRepo = (preference, o) -> {
|
||||||
@Override
|
PasswordRepository.closeRepository();
|
||||||
public boolean onPreferenceChange(Preference preference, Object o) {
|
getPreferenceManager().getSharedPreferences().edit().putBoolean("repo_changed", true).apply();
|
||||||
PasswordRepository.closeRepository();
|
return true;
|
||||||
getPreferenceManager().getSharedPreferences().edit().putBoolean("repo_changed", true).apply();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
findPreference("pref_select_external").setOnPreferenceChangeListener(resetRepo);
|
findPreference("pref_select_external").setOnPreferenceChangeListener(resetRepo);
|
||||||
|
|
Loading…
Reference in a new issue