From cf178fb55ea7540b9feb737a9d11a79a87b8a593 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 15 Aug 2013 21:23:38 +0300 Subject: [PATCH] Fix finish after deletion --- src/ro/ieval/unical/DeleteEventDialog.java | 3 +-- src/ro/ieval/unical/DisplayEventActivity.java | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ro/ieval/unical/DeleteEventDialog.java b/src/ro/ieval/unical/DeleteEventDialog.java index 806db7e..f3e661d 100644 --- a/src/ro/ieval/unical/DeleteEventDialog.java +++ b/src/ro/ieval/unical/DeleteEventDialog.java @@ -11,7 +11,6 @@ import android.os.Bundle; @SuppressLint("ValidFragment") public final class DeleteEventDialog extends DialogFragment { private Event event; - public boolean deleted=false; @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { @@ -22,7 +21,7 @@ public final class DeleteEventDialog extends DialogFragment { @Override public void onClick(final DialogInterface dialog, final int id) { event.delete(getActivity()); - deleted=true; + getActivity().finish(); } }) .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { diff --git a/src/ro/ieval/unical/DisplayEventActivity.java b/src/ro/ieval/unical/DisplayEventActivity.java index 906ed5c..79c053e 100644 --- a/src/ro/ieval/unical/DisplayEventActivity.java +++ b/src/ro/ieval/unical/DisplayEventActivity.java @@ -56,13 +56,6 @@ public class DisplayEventActivity extends Activity { description.setText(event.description); } - @Override - protected void onResume () { - super.onResume(); - if(d.deleted) - finish(); - } - @Override public boolean onCreateOptionsMenu(final Menu menu) { final MenuInflater inflater = getMenuInflater(); -- 2.39.2