Prevent crash

pull/157/head
M66B 5 years ago
parent 4797737b79
commit 2a03d75639

@ -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);

@ -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) {

Loading…
Cancel
Save