diff --git a/app/src/main/java/eu/faircode/email/DialogFragmentEx.java b/app/src/main/java/eu/faircode/email/DialogFragmentEx.java index 58b45a558f..63a2966957 100644 --- a/app/src/main/java/eu/faircode/email/DialogFragmentEx.java +++ b/app/src/main/java/eu/faircode/email/DialogFragmentEx.java @@ -12,6 +12,15 @@ import static android.app.Activity.RESULT_CANCELED; public class DialogFragmentEx extends DialogFragment { private boolean once = false; + @Override + public void onStart() { + try { + super.onStart(); + } catch (Throwable ex) { + Log.e(ex); + } + } + @Override public void onDismiss(@NonNull DialogInterface dialog) { sendResult(RESULT_CANCELED); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java index f251730a61..39c4fb9668 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java @@ -280,10 +280,10 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); - return new TimePickerDialog(getActivity(), this, + return new TimePickerDialog(getContext(), this, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), - DateFormat.is24HourFormat(getActivity())); + DateFormat.is24HourFormat(getContext())); } public void onTimeSet(TimePicker view, int hour, int minute) {