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:com.lge.friendsCamera.Utils.java

public static void showSelectDialog(Context context, String title, String message,
        DialogInterface.OnClickListener positiveListener, DialogInterface.OnClickListener cancelListener) {
    AlertDialog.Builder alert = new AlertDialog.Builder(context);
    alert.setTitle(title);
    alert.setMessage(message);//from  w w w  .j a  v a 2  s.  c  o  m
    alert.setPositiveButton("Ok", positiveListener);
    alert.setNegativeButton("Cancel", cancelListener);
    alert.setCancelable(false);
    alert.show();
}

From source file:com.lge.friendsCamera.Utils.java

public static void showTextDialog(Context context, String title, String body) {
    AlertDialog.Builder alert = new AlertDialog.Builder(context);
    alert.setTitle(title);
    alert.setMessage(body);/*from   w w  w. j a v a 2 s.c  o  m*/
    alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {

        }
    });
    alert.show();
}

From source file:Main.java

/**
 * Shows an alert dialog with OK button/*from  w  w w.j a  v  a 2  s  . co  m*/
 *
 */
public static void showAlertDialog(Context ctx, String title, String body,
        DialogInterface.OnClickListener okListener) {

    if (okListener == null) {
        okListener = new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                dialog.cancel();
            }
        };
    }

    AlertDialog.Builder builder = new AlertDialog.Builder(ctx).setMessage(body).setPositiveButton("OK",
            okListener);

    if (!TextUtils.isEmpty(title)) {
        builder.setTitle(title);
    }

    builder.show();
}

From source file:Main.java

public static AlertDialog.Builder dialogBuilder(Context context, String title, String msg, int i) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    if (msg != null) {
        builder.setMessage(Html.fromHtml(msg));
    }//from   w w  w. j a va 2s  .  c o m
    if (title != null) {
        builder.setTitle(title);
    }
    return builder;
}

From source file:net.openwatch.acluaz.http.OWServiceRequests.java

private static void showReportSubmittedDialog() {

    if (MainActivity.context != null) {
        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.context);
        builder.setTitle(R.string.form_success_title).setMessage(R.string.form_success)
                .setPositiveButton(R.string.dialog_ok, new OnClickListener() {

                    @Override//w ww  .ja v  a  2  s  .  c om
                    public void onClick(DialogInterface arg0, int arg1) {
                        arg0.dismiss();
                    }
                }).show();
    }
}

From source file:com.hybris.mobile.app.commerce.utils.UIUtils.java

/**
 * Show alert message/*from   www. j  av a2s. c o m*/
 *
 * @param context
 * @param title
 * @param message
 */
public static void showAlertMessage(Context context, String title, String message) {

    AlertDialog.Builder builder = new AlertDialog.Builder(
            new ContextThemeWrapper(context, R.style.AlertDialogCustom));
    builder.setTitle(title).setIcon(android.R.drawable.ic_dialog_alert).setMessage(message).setCancelable(true)
            .setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.dismiss();
                }
            });
    AlertDialog alert = builder.create();
    alert.show();
}

From source file:Main.java

public static AlertDialog newYesNoDialog(Context context, String s, String s1, int i,
        android.content.DialogInterface.OnClickListener onclicklistener) {
    android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(context);
    builder.setCancelable(false);/*  w w w .j  av a  2s .c  o  m*/
    builder.setPositiveButton(0x1040013, onclicklistener);
    builder.setNegativeButton(0x1040009, onclicklistener);
    builder.setTitle(s);
    builder.setMessage(s1);
    builder.setIcon(i);
    return builder.create();
}

From source file:Main.java

public static AlertDialog newYesNoDialog(final Activity activity, String dialogTitle, String screenMessage,
        int iconResourceId, OnClickListener listener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setCancelable(false);//from  w  w  w  .  ja  v a2s .com
    builder.setPositiveButton(android.R.string.yes, listener);
    builder.setNegativeButton(android.R.string.no, listener);

    builder.setTitle(dialogTitle);
    builder.setMessage(screenMessage);
    builder.setIcon(iconResourceId);

    return builder.create();
}

From source file:Main.java

/**
 * Creates a new Yes/No AlertDialog// ww  w .  jav a2 s .c om
 * 
 * @param context
 * @param dialogTitle
 * @param screenMessage
 * @param iconResourceId
 * @param listener
 * @return
 */
public static AlertDialog newYesNoDialog(final Context context, String dialogTitle, String screenMessage,
        int iconResourceId, OnClickListener listener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setCancelable(false);
    builder.setPositiveButton(android.R.string.yes, listener);
    builder.setNegativeButton(android.R.string.no, listener);

    builder.setTitle(dialogTitle);
    builder.setMessage(screenMessage);
    builder.setIcon(iconResourceId);

    return builder.create();
}

From source file:net.naonedbus.utils.InfoDialogUtils.java

/**
 * Crer une dialog avec le titre et le contenu donn.
 * /*from w w  w .  j av  a  2  s .c  o m*/
 * @param context
 * @param titleId
 * @param messageId
 * @return La dialogue.
 */
public static AlertDialog getDialog(final Context context, final int titleId, final int messageId) {

    final AlertDialog.Builder moreDetailsDialog = new AlertDialog.Builder(context);
    moreDetailsDialog.setTitle(context.getString(titleId));
    moreDetailsDialog.setMessage(context.getString(messageId));
    moreDetailsDialog.setPositiveButton(android.R.string.ok, null);

    return moreDetailsDialog.create();
}