1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 17:27:00 +00:00

Confirm resetting questions

This commit is contained in:
M66B 2021-04-15 17:52:44 +02:00
parent ef8e6d6094
commit aeeeb98e86

View file

@ -838,7 +838,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
private void onResetQuestions() { private void onResetQuestions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final Context context = getContext();
new AlertDialog.Builder(context)
.setTitle(R.string.title_setup_reset_questions)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit(); SharedPreferences.Editor editor = prefs.edit();
for (String option : RESET_QUESTIONS) for (String option : RESET_QUESTIONS)
editor.remove(option); editor.remove(option);
@ -847,7 +853,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
editor.remove(key); editor.remove(key);
editor.apply(); editor.apply();
ToastEx.makeText(getContext(), R.string.title_setup_done, Toast.LENGTH_LONG).show(); ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show();
}
})
.setNegativeButton(android.R.string.cancel, null)
.show();
} }
private void onCleanup() { private void onCleanup() {