code: public void confirm(final int title, final int message,
                          final DialogInterface.OnClickListener onClickListener) {
          final AlertDialog.Builder builder = new AlertDialog.Builder(
                  getContext());
          builder.setTitle(title).setIcon(android.R.drawable.ic_dialog_info).setMessage(message);
          builder.setPositiveButton(android.R.string.ok,
                  new DialogInterface.OnClickListener() {
  
                      @Override
                      public void onClick(final DialogInterface dialog,
                                          final int which) {
                          if (onClickListener != null) {
                              onClickListener.onClick(dialog, which);
                          }
  
                      }
                  });
          builder.setNegativeButton(android.R.string.cancel,
                  new DialogInterface.OnClickListener() {
  
                      @Override
                      public void onClick(final DialogInterface dialog,
                                          final int which) {
                          if (onClickListener != null) {
                              onClickListener.onClick(dialog, which);
                          }
                      }
                  });
          builder.show();
      }
docs: Open a confirm dialog with title and message
  
  @param title
  @param message