@SuppressLint("ValidFragment")
public final class DeleteEventDialog extends DialogFragment {
private Event event;
- public boolean deleted=false;
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
@Override
public void onClick(final DialogInterface dialog, final int id) {
event.delete(getActivity());
- deleted=true;
+ getActivity().finish();
}
})
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
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();