AlertDialog.Builder setIcon - 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 setIcon method.

This code example shows how to use the following methods:setIcon, setNegativeButton, setPositiveButton, setView
		view.setPadding(Math.round(mColorPicker.getDrawingOffset()), 0, Math.round(mColorPicker.getDrawingOffset()), 0);
 
		final int val = getValue();
		mColorPicker.setColor(val, true);
		mColorPicker.setAlphaSliderVisible(mAlphaSliderEnabled);
		builder.setView(view);
		builder.setIcon(new BitmapDrawable(context.getResources(), getColorPreviewBitmap(context, val)));
		builder.setPositiveButton(android.R.string.ok, this);
		builder.setNegativeButton(android.R.string.cancel, null);
	} 
 
	@Override 
	protected void onSetInitialValue(final boolean restoreValue, final Object defaultValue) {
		if (isPersistent() && defaultValue instanceof Integer) {
			persistInt(restoreValue ? getValue() : (Integer) defaultValue);
		} 
	} 
 
	private int getValue() { 
		try { 
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, setIcon, setMessage, setNegativeButton, setPositiveButton
This code example shows how to use the following methods:create, setCancelable, setIcon, setMessage, setTitle
	private Toast toast;
	 
	@Override 
	public AlertDialog show(Context context, String title, String message) {
		AlertDialog.Builder builder = makeBuilder(context);
		builder.setTitle(title);
		 
		if(drawables != null) {
			builder.setIcon(drawables.getDrawable("socialize_icon_white.png"));
		} 
		 
		if(!StringUtils.isEmpty(message)) {
			builder.setMessage(message);
		} 
		 
		builder.setCancelable(true)
		.setPositiveButton("OK", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				dialog.dismiss();
			} 

8
CodeRank
This code example shows how to use the following methods:create, setCancelable, setIcon, setMessage, setNegativeButton
     * @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();
    } 
 
    /** 
     * Creates a new AlertDialog to display a simple message 
     * 
6
CodeRank
This code example shows how to use the following methods:create, setCancelable, setIcon, setMessage, setNegativeButton
     * @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();
    } 
 
    /** 
     * Creates a new AlertDialog to display a simple message 
     * 
6
CodeRank
This code example shows how to use the following methods:setIcon, setMessage, setTitle, show
	} 
	 
	@Override 
	protected boolean onTap(int index) {
		OverlayItem item=mOverlays.get(index);
		Builder dialog=new Builder(mContext);
		dialog.setTitle("User: "+item.getTitle());
		dialog.setMessage(item.getSnippet());
		dialog.setIcon(R.drawable.ic_dialog);
		dialog.show();
		return true; 
	} 
	 
	@Override 
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		super.draw(canvas, mapView, false);
	} 
	 
	public ArrayList<OverlayItem> getOverlayItems() {
		return mOverlays;
6
CodeRank
This code example shows how to use the following methods:setIcon, setNegativeButton, setPositiveButton, setView
		view.addView(mColorPicker, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		view.setPadding(Math.round(mColorPicker.getDrawingOffset()), 0, Math.round(mColorPicker.getDrawingOffset()), 0);
 
		mColorPicker.setColor(mValue, true);
		mColorPicker.setAlphaSliderVisible(mAlphaSliderEnabled);
		builder.setView(view);
		builder.setIcon(new BitmapDrawable(context.getResources(), getColorPreviewBitmap(context, mValue)));
		builder.setPositiveButton(android.R.string.ok, this);
		builder.setNegativeButton(android.R.string.cancel, null);
	} 
 
	@Override 
	protected void onSetInitialValue(final boolean restoreValue, final Object defaultValue) {
		if (isPersistent()) {
			persistInt(restoreValue ? getValue() : (Integer) defaultValue);
		} 
	} 
 
	private int getValue() { 
		try { 
6
CodeRank
This code example shows how to use the following methods:create, setIcon, setMessage, setPositiveButton, setTitle
    } 
  } 
 
  private void a(String paramString1, String paramString2)
  { 
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle(paramString2);
    localBuilder.setMessage(paramString1);
    localBuilder.setIcon(2130837676);
    localBuilder.setPositiveButton(Strings.getString(2131296259), new b(this));
    this.b = localBuilder.create();
    this.b.setCanceledOnTouchOutside(false);
    if (!isFinishing()) 
      this.b.show();
  } 
 
  private ArrayList d()
  { 
    ArrayList localArrayList = new ArrayList();
    String str1 = AVSettings.getFindRUser(this);
6
CodeRank

Related AlertDialog.Builder setIcon Questions & Answers:

setIcon Method Overview
Set the Drawable to be used in the title.
See Code Examples for other Android AlertDialog.Builder Methods: