I'm learning and remembering Android and I want to understand my mistakes.
This is my confirm/cancel AlertDialog class. Created it in separate class to split code and not put everything in one Activity:

```
public class ConversationAlertDialog extends DialogFragment {

    public static Dialog createDialog(Context context) {
        // Use the Builder class for convenient dialog construction
        AlertDialog.Builder builder = new AlertDialog.Builder(context);

        builder.setMessage("Continue?")
               .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // User confirms

                    }
                })
                .setNegativeButton("No", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // User cancelled
                    }
                });
        // Create the AlertDialog object and return it
        return builder.create();
    }
}

```

This is my Activity where I show AlertDialog:

```
    buttonConvert.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ConversationAlertDialog.createDialog(ConversionActivity.this).show();
        }
    });

```

Next I want to create callback so I could write Dialog cancel/confirm behaviour in Activity. This way it will be also easier to use code that is already written in Activity. I am still learning about callbacks so not sure, but I think I should implement interface.

All kind of tips would help me.