code: public void alert(final int title, final int message,
                        final DialogInterface.OnClickListener onClickListener) {
  
          final AlertDialog.Builder builder = new AlertDialog.Builder(
                  getContext());
          builder.setTitle(title);
          builder.setMessage(message);
          builder.setIcon(android.R.drawable.ic_dialog_alert);
          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);
                          }
                          final AlertDialog ad = builder.create();
                          ad.cancel();
                      }
                  });
          builder.show();
      }
docs: Open a alert dialog with title and message
  
  @param title
  @param message