package br.com.ema.dialogs;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;

import br.com.ema.R;


public class FinishGameDialogFragment extends DialogFragment {
    private static final String TAG = "FinishDialogFragment";

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setMessage(R.string.areYouSure)
                .setPositiveButton(R.string.finish, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // Finish the game
                    }
                })
                .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        Log.i(TAG, "User cancelled the the end of the game.");
                    }
                });
        // Create the AlertDialog object and return it
        return builder.create();
    }

}

@@ -230,17 +230,16 @@
 ema.R;%0A%0A
-%0A
 public c
@@ -752,12 +752,21 @@
     
-// F
+Log.i(TAG, %22f
 inis
@@ -775,16 +775,67 @@
 the game
+%22);%0A                        getActivity().finish();
 %0A       
@@ -1159,63 +1159,8 @@
 %7D);%0A
-        // Create the AlertDialog object and return it%0A
     

Add action to finish the activity.