]> iEval git - unical.git/blame - src/ro/ieval/unical/DeleteEventDialog.java
Edit event. work in progress[3]
[unical.git] / src / ro / ieval / unical / DeleteEventDialog.java
CommitLineData
46e6c000
PT
1package ro.ieval.unical;
2
dd76f98a
PT
3import android.annotation.SuppressLint;
4import android.app.Activity;
46e6c000
PT
5import android.app.AlertDialog;
6import android.app.Dialog;
7import android.app.DialogFragment;
8import android.content.DialogInterface;
9import android.os.Bundle;
10
dd76f98a 11@SuppressLint("ValidFragment")
5cf4714f 12public final class DeleteEventDialog extends DialogFragment {
f580909c
MG
13 private final Event event;
14 private final Activity activity;
15
16 public DeleteEventDialog(final Event event, final Activity activity) {
17 super();
18 this.event=event;
19 this.activity=activity;
20 }
21
46e6c000 22 @Override
8a08d036
MG
23 public Dialog onCreateDialog(final Bundle savedInstanceState) {
24 final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
25 builder.setMessage(R.string.askdeleteevent)
26 .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
27 @Override
28 public void onClick(final DialogInterface dialog, final int id) {
f580909c
MG
29 event.delete(getActivity());
30 activity.finish();
8a08d036
MG
31 }
32 })
33 .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
34 @Override
35 public void onClick(final DialogInterface dialog, final int id) {
36 // User cancelled the dialog
37 }
38 });
39 return builder.create();
40 }
46e6c000 41}
This page took 0.037993 seconds and 4 git commands to generate.