Example usage for android.app AlertDialog setMessage

List of usage examples for android.app AlertDialog setMessage

Introduction

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

Prototype

public void setMessage(CharSequence message) 

Source Link

Usage

From source file:Main.java

public static void alertMessage(Context context, String msg) {
    AlertDialog alertBuilder = new AlertDialog.Builder(context).create();
    alertBuilder.setMessage(msg);
    alertBuilder.show();/*from   ww w .  j  a  v a 2 s.c o m*/
}

From source file:Main.java

public static AlertDialog clearDialog(final Activity var0, final String var1, final String var2) {
    Builder builder = new Builder(var0);
    AlertDialog dialog = builder.create();
    dialog.setTitle(var1);
    dialog.setMessage(var2);
    return dialog;
}

From source file:Main.java

public static void showAlert(Context context, String title, String text) {
    AlertDialog alertDialog = new Builder(context).create();
    alertDialog.setTitle(title);//  w ww .  j a v  a 2  s  . c o m
    alertDialog.setMessage(text);
    alertDialog.setCanceledOnTouchOutside(true);
    alertDialog.show();
}

From source file:Main.java

public static void showAlertError(Context context, String Error) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();
    alertDialog.setTitle("Error");
    alertDialog.setMessage(Error);
    alertDialog.show();//from w  ww.  jav a2 s . c  om
}

From source file:Main.java

public static void showWarningDialogStatic(String title, String message, Context ctx) {
    AlertDialog alertDialog = new AlertDialog.Builder(ctx).create();
    alertDialog.setTitle(title);/*from   w w w. j ava 2  s.  c o  m*/
    alertDialog.setMessage(message);
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            // here you can add functions
        }
    });
    alertDialog.show();
}

From source file:Main.java

public static void showAlertDialog(Context context, String title, String message) {
    AlertDialog dialog = new AlertDialog.Builder(context).create();
    dialog.setCancelable(true);// www.  ja  va  2  s. c  o m
    dialog.setMessage(message);
    dialog.setTitle(title);
    dialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
        }
    });
    dialog.show();
}

From source file:Main.java

public static void showAlert(String msg, Context context) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();
    alertDialog.setTitle("Alert");
    alertDialog.setMessage(msg);
    alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();/*  w w w.j  a  v a2 s .c o m*/
        }
    });
    alertDialog.show();
}

From source file:Main.java

public static void displayInfo(Context context, String title, String message) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();
    alertDialog.setTitle(title);/*from  w ww . java 2  s .  c om*/
    alertDialog.setMessage(message);
    alertDialog.setIcon(android.R.drawable.ic_dialog_info);
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            return;
        }
    });
    alertDialog.show();
}

From source file:Main.java

public static void showAlertDialog(Context ctx, String title, String message) {

    AlertDialog alertDialog = new AlertDialog.Builder(ctx).create();
    alertDialog.setTitle(title);//from   w w  w  .j  a v  a  2  s . co m
    alertDialog.setMessage(message);

    alertDialog.setButton(DialogInterface.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });
    alertDialog.show();
}

From source file:Main.java

public static void displayAlert(Context context, String title, String message) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();
    alertDialog.setTitle(title);/*from   w ww  .  j  a va  2  s  .  c  o  m*/
    alertDialog.setMessage(message);
    alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            return;
        }
    });
    alertDialog.show();
}