Example usage for android.app AlertDialog.Builder setMessage

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

Introduction

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

Prototype

public void setMessage(CharSequence message) 

Source Link

Usage

From source file:Main.java

static void alert(Activity act, String Tag, String message) {
    AlertDialog.Builder bld = new AlertDialog.Builder(act);
    bld.setMessage(message);
    bld.setNeutralButton("OK", null);
    Log.d(Tag, "Showing alert dialog: " + message);
    bld.create().show();//from ww  w  . jav a 2 s .co  m
}

From source file:Main.java

public static Dialog createMessageDialog(Context context, String message) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setMessage(message).setCancelable(true);
    AlertDialog alert = builder.create();
    return alert;
}

From source file:Main.java

public static AlertDialog createAlertDialog(Activity activity, String message, String title) {
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setMessage(message);
    builder.setNeutralButton("OK", null);
    return builder.create();
}

From source file:Main.java

public static void okButtonAlertDialog(String message, Context context) {
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
    alertDialog.setMessage(message);
    alertDialog.setPositiveButton("Ok", null);
    alertDialog.setCancelable(false);//  ww w. ja v a2s.com
    alertDialog.show();
}

From source file:Main.java

public static void showProgressDialog(Context mCtx, String msg) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(mCtx);
    builder.setMessage(msg);
    builder.setCancelable(false);/*www  .ja va2  s .c om*/

    final AlertDialog dialog = builder.create();
    dialog.show();
}

From source file:Main.java

/**
 * create dialog/*from w  w w.j a  v  a2 s  .  c  o  m*/
 */

public static void callDialog(Context ctx, String msg, String title) {

    AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
    builder.setMessage(msg).setTitle(title).setPositiveButton(android.R.string.ok, null);
    AlertDialog dialog = builder.create();
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
}

From source file:Main.java

/**
 * @param s/*from   w ww .  j a  v  a2  s . c o m*/
 *            The alert message Displays an alert dialog with the messaged
 *            provided
 */
public static void showAlert(Context context, String mesg) {
    AlertDialog.Builder alt_bld = new AlertDialog.Builder(context);
    alt_bld.setMessage(mesg).setPositiveButton(android.R.string.ok, null);
    AlertDialog alert = alt_bld.create();
    alert.show();
}

From source file:Main.java

public static void showInfoDialog(Context ctx, String msg) {
    AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
    builder.setMessage(msg);
    builder.setPositiveButton(ctx.getString(android.R.string.ok), new OnClickListener() {
        public void onClick(DialogInterface dialog, int arg1) {
            dialog.cancel();/*from   ww w  .  j a  v  a 2s.co  m*/
        }
    });
    AlertDialog alert = builder.create();
    alert.show();
}

From source file:Main.java

public static void ShowNoNetworkMessage(Context ctx) {

    AlertDialog.Builder alert = new AlertDialog.Builder(ctx);

    alert.setMessage("No network connection available.");
    //alert.setTitle("StormCloud");
    alert.setPositiveButton("OK", null);
    alert.setCancelable(true);//ww  w. j  a va  2  s. c o m
    alert.create().show();
    //return alert;

}

From source file:Main.java

public static void DialogOK(Context ctx, String text) {
    AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
    builder.setMessage(text).setCancelable(false).setPositiveButton("OK",
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();//from www . ja  v a  2  s  . c  o  m
                }
            });
    AlertDialog alert = builder.create();
    alert.show();
}