This commit is contained in:
Alexey Kulish 2016-09-15 15:19:22 +03:00
parent fc608fa7a1
commit 607fd9fdba

View file

@ -35,6 +35,7 @@ public abstract class PointEditorFragment extends Fragment {
private View view;
private EditText nameEdit;
private boolean cancelled;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
@ -72,6 +73,7 @@ public abstract class PointEditorFragment extends Fragment {
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cancelled = true;
dismiss();
}
});
@ -205,7 +207,7 @@ public abstract class PointEditorFragment extends Fragment {
@Override
public void onDestroyView() {
if (!wasSaved() && !getEditor().isNew()) {
if (!wasSaved() && !getEditor().isNew() && !cancelled) {
save(false);
}
super.onDestroyView();