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

public static void showSimpleAlertDialog(Context context, String title, String msg) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title).setMessage(msg).show();
}

From source file:Main.java

static public void showAlertDialogWithTitle(Context context, int titleResource, int stringResource,
        DialogInterface.OnClickListener positiveListener) {
    AlertDialog.Builder builder = new Builder(context);
    builder.setTitle(titleResource);
    builder.setMessage(stringResource);/*from   w w  w.  jav  a 2 s  .  c om*/
    builder.setPositiveButton(android.R.string.ok, positiveListener);
    builder.create().show();
}

From source file:Main.java

public static AlertDialog.Builder createDialog(Context context, String title, String message) {
    AlertDialog.Builder dialog = new AlertDialog.Builder(context);
    dialog.setTitle(title);
    dialog.setMessage(message);/* ww w  .j a v a  2s.c  o m*/

    return dialog;
}

From source file:Main.java

public static void showDialogAlert(Context ctx, String title, String body) {
    AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
    builder.setTitle(title);
    builder.setMessage(body);//from w w  w .  j a  v  a2 s  . c  o m
    Dialog dialogDetails = builder.create();
    dialogDetails.setCanceledOnTouchOutside(true);
    dialogDetails.show();
}

From source file:Main.java

public static final void showAlertDialog(Activity ctx, String title, String text) {
    AlertDialog.Builder alertBuilder = new AlertDialog.Builder(ctx);
    alertBuilder.setTitle(title);
    alertBuilder.setMessage(text);/*from   w ww  .  j a v  a2  s.c o m*/
    AlertDialog alert = alertBuilder.create();
    alert.show();
}

From source file:Main.java

public static void showAlertDialog(Context context, String title, String message) {
    AlertDialog.Builder dialog = new AlertDialog.Builder(context);
    dialog.setTitle(title);
    dialog.setMessage(message);// ww  w.j  a v  a 2s  .c  o m
    dialog.setIcon(android.R.drawable.ic_dialog_alert);
    dialog.setPositiveButton(android.R.string.ok, null);
    dialog.show();
}

From source file:Main.java

public static AlertDialog.Builder createAlertDialog(Context context, String title, View dialogView) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title);
    builder.setCancelable(false);/*from w w w  .j a  va  2 s .  c  o  m*/
    builder.setView(dialogView);
    return builder;
}

From source file:Main.java

public static void showAlert(Context context, String title, String msg, String button) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(title).setMessage(msg).setCancelable(false)
            .setPositiveButton(button, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();/*from   w  ww  .j  ava 2 s.co m*/
                }
            }).show();
}

From source file:Main.java

static public void ok_dialog(Context ctx, String title, String text) {
    AlertDialog.Builder ad;
    ad = new AlertDialog.Builder(ctx);
    ad.setTitle(title);
    ad.setMessage(text);//w w  w . jav  a2 s . c om
    ad.setPositiveButton("Ok", null);
    ad.show();
}

From source file:Main.java

public static AlertDialog makeAlertDialog(Context context, int titleId, int messageId, int postiveId,
        OnClickListener positiveListener, int NegativeId, OnClickListener negativeListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(titleId);
    builder.setMessage(messageId);/*from  w ww.  j  a va  2s  .  co  m*/
    builder.setPositiveButton(postiveId, positiveListener);
    builder.setNegativeButton(NegativeId, negativeListener);
    return builder.create();
}