Language

AlertDialog.Builder.SetIcon Method

Definition

Overloads

Name Description
SetIcon(Drawable)

Set the Drawable to be used in the title.

SetIcon(Int32)

Set the resource id of the Drawable to be used in the title.

SetIcon(Drawable)

Set the Drawable to be used in the title.

[Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)Landroid/app/AlertDialog$Builder;", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")]
public virtual Android.App.AlertDialog.Builder SetIcon(Android.Graphics.Drawables.Drawable icon);
[<Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)Landroid/app/AlertDialog$Builder;", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")>]
abstract member SetIcon : Android.Graphics.Drawables.Drawable -> Android.App.AlertDialog.Builder
override this.SetIcon : Android.Graphics.Drawables.Drawable -> Android.App.AlertDialog.Builder

Parameters

icon
Drawable

Drawable

Returns

this Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set the Drawable to be used in the title. Note: To ensure consistent styling, the drawable should be inflated or constructed using the alert dialog's themed context obtained via getContext().

Android reference for android.app.AlertDialog.Builder.setIcon.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetIcon(Int32)

Set the resource id of the Drawable to be used in the title.

[Android.Runtime.Register("setIcon", "(I)Landroid/app/AlertDialog$Builder;", "GetSetIcon_IHandler")]
public virtual Android.App.AlertDialog.Builder SetIcon(int iconId);
[<Android.Runtime.Register("setIcon", "(I)Landroid/app/AlertDialog$Builder;", "GetSetIcon_IHandler")>]
abstract member SetIcon : int -> Android.App.AlertDialog.Builder
override this.SetIcon : int -> Android.App.AlertDialog.Builder

Parameters

iconId
Int32

int

Returns

This Builder object to allow for chaining of calls to set methods

Attributes

Remarks

Set the resource id of the Drawable to be used in the title. Takes precedence over values set using setIcon(Drawable).

Android reference for android.app.AlertDialog.Builder.setIcon.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to