AlertDialog.Builder create - 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 create 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: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: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
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("确认",  
        new android.content.DialogInterface.OnClickListener() 
        {   
            public void onClick(DialogInterface dialog, int which) {  
                dialog.dismiss();  
                callBack.callBack();
            }   
        });  
         
        builder.setNegativeButton("取消",  
        new android.content.DialogInterface.OnClickListener() 
        {   

6
CodeRank
This code example shows how to use the following methods:create, setCancelable, setMessage, setNegativeButton, setPositiveButton
	@Override 
	protected Dialog onCreateDialog(int id) {
		switch (id) {
		case DIALOG_ALERT:
			// Create out AlterDialog 
			Builder builder = new AlertDialog.Builder(this);
			builder.setMessage("This will end the activity");
			builder.setCancelable(true);
			builder.setPositiveButton("I agree", new OkOnClickListener());
			builder.setNegativeButton("No, no", new CancelOnClickListener());
			AlertDialog dialog = builder.create();
			dialog.show();
		} 
		return super.onCreateDialog(id);
	} 
 
	private final class CancelOnClickListener implements 
			DialogInterface.OnClickListener {
		public void onClick(DialogInterface dialog, int which) {
			Toast.makeText(getApplicationContext(), "Activity will continue",
8
CodeRank

Related AlertDialog.Builder create Questions & Answers:

Other AlertDialog.Builder create Examples

63:		 * */
64:		public void showAlertDialog(Context context, String title, String message, Boolean status) {
65:			AlertDialog alertDialog = new AlertDialog.Builder(context).create();
66:	
67:			// Setting Dialog Title

Read More

17:		public void showAlertDialog(Context context, String title, String message,
18:				Boolean status) {
19:			AlertDialog alertDialog = new AlertDialog.Builder(context).create();
20:	
21:			// Setting Dialog Title

Read More

15:		public void showAlertDialog(Context context, String title, String message,
16:				Boolean status) {
17:			AlertDialog alertDialog = new AlertDialog.Builder(context).create();
18:	
19:			// Setting Dialog Title

Read More

create Method Overview
Creates a AlertDialog with the arguments supplied to this builder.
See Code Examples for other Android AlertDialog.Builder Methods: