AlertDialog.Builder setMessage - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AlertDialog.Builder setMessage method.

This code example shows how to use the following methods:create, setMessage, setTitle
     * @param text 
     *          Alert dialog message 
     */ 
    @Deprecated 
    public static void showAlert(Context context, String title, String text) {
        Builder alertBuilder = new Builder(context);
        alertBuilder.setTitle(title);
        alertBuilder.setMessage(text);
        alertBuilder.create().show();
    } 
} 
9
CodeRank
This code example shows how to use the following methods:addLinks, setMessage
    public static SpannableString getLinkifiedText(Context context, int textId) {
        return getLinkifiedText(context.getText(textId));
    } 
 
    public static SpannableString getLinkifiedText(CharSequence text) {
        final SpannableString msg = new SpannableString(text);
        Linkify.addLinks(msg, Linkify.ALL);
        return msg;
    } 
 
    /* 
     * confirmation dialogs 
     */ 
 
    public static AlertDialog.Builder buildConfirmationDialog(Context context, int titleId, int msgId) {
        return new AlertDialog.Builder(context)
            .setTitle(titleId)
            .setMessage(getLinkifiedText(context, msgId));
    } 
 

6
CodeRank
This code example shows how to use the following methods:create, setMessage, setPositiveButton, setTitle
		} 
 
		protected void loginFail(String message) {
			if (dialog != null && dialog.isShowing()) {
				dialog.cancel();
				AlertDialog.Builder builder = new Builder(context);
				builder.setMessage(message);
				builder.setTitle("登录失败!");
 
				builder.setPositiveButton("确定",
						new android.content.DialogInterface.OnClickListener() {
							@Override 
							public void onClick(DialogInterface dialog,
									int which) {
								dialog.dismiss();
							} 
						}); 
				builder.create().show();
			} 
		} 

6
CodeRank
This code example shows how to use the following methods:create, setMessage, setTitle
     *          Alert dialog title 
     * @param text 
     *          Alert dialog message 
     */ 
    public static void showAlert(Context context, String title, String text) {
        Builder alertBuilder = new Builder(context);
        alertBuilder.setTitle(title);
        alertBuilder.setMessage(text);
        alertBuilder.create().show();
    } 
 
    /** 
     * A proxy for Log.d api that kills log messages in release build. It 
     * not recommended to send sensitive information to log output in 
     * shipping apps. 
     * 
     * @param tag 
     * @param msg 
     */ 
    public static void logd(String tag, String msg) {
8
CodeRank
This code example shows how to use the following methods:setCancelable, setIcon, setMessage, setPositiveButton, setTitle
                    .getClientMessageResourceId()); 
        } else { 
            screenMessage = error.getLocalizedMessage();
        } 
 
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        builder.setTitle(title);
        builder.setMessage(screenMessage);
        builder.setIcon(android.R.drawable.ic_dialog_alert);
        builder.setCancelable(false);
        builder.setPositiveButton(activity.getString(android.R.string.ok), new OnClickListener() {
 
            @Override 
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            } 
        }); 
 
        return builder;
    } 
9
CodeRank
This code example shows how to use the following methods:create, setCancelable, setIcon, setMessage, setPositiveButton
     * @param iconResourceId 
     * @return 
     */ 
    public static AlertDialog newMessageDialog(final Context context, String dialogTitle,
            String screenMessage, int iconResourceId) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setCancelable(false);
        builder.setPositiveButton("Okay", new OnClickListener() {
 
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            } 
        }); 
 
        builder.setTitle(dialogTitle);
        builder.setMessage(screenMessage);
        builder.setIcon(iconResourceId);
 
        return builder.create();
    } 

9
CodeRank
This code example shows how to use the following methods:create, setMessage, setPositiveButton, setTitle
  } 
 
  public Dialog onCreateDialog(Bundle paramBundle)
  { 
    Context localContext = al.d(getActivity());
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(localContext);
    localBuilder.setTitle(getString(2131493555));
    localBuilder.setMessage(2131493556);
    localBuilder.setPositiveButton(2131492965, new v(this, localContext));
    AlertDialog localAlertDialog = localBuilder.create();
    localAlertDialog.setInverseBackgroundForced(true);
    localAlertDialog.setCanceledOnTouchOutside(true);
    return localAlertDialog;
  } 
} 
 
/* Location:           C:\Users\sandrocheng.21KUNPENG\Desktop\classes_dex2jar.jar 
 * Qualified Name:     com.avast.android.mobilesecurity.app.filter.LGWarningDialog 
 * JD-Core Version:    0.6.2 
 */ 
6
CodeRank
This code example shows how to use the following methods:create, setMessage, setNegativeButton, setPositiveButton, setTitle
import android.content.DialogInterface.OnClickListener; 
 
public class AlertDialogFactory { 
	public static AlertDialog getConfirmDialog(Context ctx, String title,
			String msg, final DialogCallback ok) {
		AlertDialog.Builder builder = new Builder(ctx);
		builder.setTitle(title);
		builder.setMessage(msg);
		builder.setPositiveButton("确定", new OnClickListener() {
 
			public void onClick(DialogInterface dialog, int which) {
				ok.execute();
			} 
		}); 
		builder.setNegativeButton("取消", new OnClickListener() {
			 
			public void onClick(DialogInterface dialog, int which) {
				ok.cancle();
			} 
		}); 

6
CodeRank
This code example shows how to use the following methods:create, setMessage, setNegativeButton, setPositiveButton, setTitle
{ 
	public static void dialogBuilder( Activity instance, String title, 
			String message,
			final DialogCallBack callBack)
	{ 
        AlertDialog.Builder builder = new Builder(instance);
        builder.setMessage( message );  
        builder.setTitle( title );  
        builder.setPositiveButton("OK",  
        new android.content.DialogInterface.OnClickListener() 
        {   
            public void onClick(DialogInterface dialog, int which) {  
                dialog.dismiss();  
                callBack.callBack();
            }   
        });  
         
        builder.setNegativeButton("Cancel",  
        new android.content.DialogInterface.OnClickListener() 
        {   

6
CodeRank
This code example shows how to use the following methods:create, setIcon, setMessage, setNegativeButton, setPositiveButton

Related AlertDialog.Builder setMessage Questions & Answers:

Other AlertDialog.Builder setMessage Examples

63:	         AlertDialog.Builder dialog = new AlertDialog.Builder(this.context);
64:	         dialog.setTitle(item.getTitle());
65:	         dialog.setMessage(item.getSnippet());
66:	         dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
67:	 			public void onClick(DialogInterface dialog, int which) {

Read More

158:			// Setting Dialog Message
159:			alertDialog
160:					.setMessage("GPS is not enabled. Do you want to go to settings menu?");
161:	
162:			// On pressing Settings button

Read More

157:	 
158:	        // Setting Dialog Message
159:	        alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
160:	 
161:	        // On pressing Settings button

Read More

setMessage Method Overview
Set the message to display.
See Code Examples for other Android AlertDialog.Builder Methods: