Example usage for android.app AlertDialog.Builder setTitle

List of usage examples for android.app AlertDialog.Builder setTitle

Introduction

In this page you can find the example usage for android.app AlertDialog.Builder setTitle.

Prototype

@Override
    public void setTitle(CharSequence title) 

Source Link

Usage

From source file:Main.java

/**
 * //from  ww w.  j a  v  a2  s. c  o m
 * @param title
 * @param message
 */
public static void showDialog(String title, String message, Activity activity) {
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setTitle(title);
    builder.setMessage(message);
    builder.setPositiveButton("Yes", null);
    builder.create().show();
}

From source file:Main.java

public static void showCustomButtonsAlertWithListener(final Context context, String positiveButtonText,
        String negativeButtonText, String title, String message,
        DialogInterface.OnClickListener dialogClickListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title).setMessage(message).setPositiveButton(positiveButtonText, dialogClickListener)
            .setNegativeButton(negativeButtonText, dialogClickListener).show();
}

From source file:Main.java

public static void showOkAlertWithListener(final Context context, String title, String message,
        DialogInterface.OnClickListener dialogClickListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title).setMessage(message).setPositiveButton("Ok", dialogClickListener).show();
}

From source file:Main.java

/**
 * //from w w  w . j  ava  2  s  . c  o  m
 * @param context
 * @param strTitle
 * @param strText
 * @param icon
 */
public static void showDialog(Activity context, String strTitle, String strText, int icon) {
    AlertDialog.Builder tDialog = new AlertDialog.Builder(context);
    tDialog.setTitle(strTitle);
    tDialog.setMessage(strText);
    tDialog.setPositiveButton(android.R.string.ok, null);
    tDialog.show();
}

From source file:Main.java

public static void addMsgOk(Activity activity, String titulo, String msg, int icone) {
    AlertDialog.Builder builderDialog = new AlertDialog.Builder(activity);
    builderDialog.setTitle(titulo);
    builderDialog.setMessage(msg);/*from ww w  .  j  a va 2s. c  o m*/
    builderDialog.setNeutralButton("Ok", null);
    builderDialog.setIcon(icone);
    builderDialog.show();
}

From source file:Main.java

public static void alert(String title, String message, Activity activity,
        DialogInterface.OnClickListener listener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setTitle(title);
    builder.setMessage(message);//from w  ww. ja  v a  2s  .co  m
    builder.setPositiveButton("OK", listener);
    AlertDialog alert = builder.create();
    alert.show();
}

From source file:Main.java

public static void showDialog(Context context, String title, String message, String buttonText,
        DialogInterface.OnClickListener buttonClickListener) {
    AlertDialog.Builder dlg = new AlertDialog.Builder(context);
    dlg.setTitle(title);
    dlg.setMessage(message);/* w  ww  .ja  v a  2 s  .com*/
    dlg.setCancelable(false);
    dlg.setPositiveButton(buttonText, buttonClickListener);
    dlg.create();
    dlg.show();
}

From source file:Main.java

public static void showYesNoPrompt(Context _context, String title, String message,
        OnClickListener onYesListener, OnClickListener onNoListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(_context);
    builder.setTitle(title);
    builder.setIcon(android.R.drawable.ic_dialog_info); // lame icon
    builder.setMessage(message);/*from   www. j ava  2s. c  om*/
    builder.setCancelable(false);
    builder.setPositiveButton("Yes", onYesListener);
    builder.setNegativeButton("No", onNoListener);
    builder.show();
}

From source file:Main.java

public static void showMessage(Context _context, String title, String message, int icon,
        DialogInterface.OnClickListener ackHandler) {
    AlertDialog.Builder builder = new AlertDialog.Builder(_context);
    builder.setTitle(title);
    builder.setMessage(Html.fromHtml(message));
    builder.setCancelable(false);//from  w  ww.j ava  2 s  . c  o m
    builder.setPositiveButton("Acknowledged", ackHandler);
    builder.setIcon(icon);
    builder.show();
}

From source file:Main.java

public static void mostrarCaixaDialogoSimples(Context context, String titulo, String mensagem) {

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(titulo);
    builder.setMessage(mensagem);/*  w ww  . j ava 2 s .  co  m*/
    builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            dialog.dismiss();
        }
    });

    AlertDialog alertDialog = builder.create();
    alertDialog.show();
}