Builder

open class Builder(source)

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context)
Creates a builder for an alert dialog that uses the default alert dialog theme.
constructor(@NonNull context: @NonNull Context, @StyleRes themeResId: Int)
Creates a builder for an alert dialog that uses an explicit theme resource.

Functions

Link copied to clipboard
@NonNull
open fun create(): @NonNull AlertDialog
Creates an AlertDialog with the arguments supplied to this builder.
Link copied to clipboard
@NonNull
open fun getContext(): @NonNull Context
Returns a Context with the appropriate theme for dialogs created by this Builder.
Link copied to clipboard
Set a list of items, which are supplied by the given ListAdapter, to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Link copied to clipboard
Sets whether the dialog is cancelable or not.
Link copied to clipboard
open fun setCursor(cursor: Cursor, listener: DialogInterface.OnClickListener, labelColumn: String): AlertDialog.Builder
Set a list of items, which are supplied by the given Cursor, to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Link copied to clipboard
open fun setCustomTitle(@Nullable customTitleView: @Nullable View): AlertDialog.Builder
Set the title using the custom view customTitleView.
Link copied to clipboard
open fun setIcon(@Nullable icon: @Nullable Drawable): AlertDialog.Builder
Set the Drawable to be used in the title.
Set the resource id of the Drawable to be used in the title.
Link copied to clipboard
Set an icon as supplied by a theme attribute.
Link copied to clipboard
open fun setInverseBackgroundForced(useInverseBackground: Boolean): AlertDialog.Builder
Sets the Dialog to use the inverse background, regardless of what the contents is.
Link copied to clipboard
Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Link copied to clipboard
Set the message to display using the given resource id.
open fun setMessage(@Nullable message: @Nullable CharSequence): AlertDialog.Builder
Set the message to display.
Link copied to clipboard
open fun setMultiChoiceItems(cursor: Cursor, isCheckedColumn: String, labelColumn: String, listener: DialogInterface.OnMultiChoiceClickListener): AlertDialog.Builder
Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Link copied to clipboard
Set a listener to be invoked when the negative button of the dialog is pressed.
Link copied to clipboard
Set an icon to be displayed for the negative button.
Link copied to clipboard
Set a listener to be invoked when the neutral button of the dialog is pressed.
Link copied to clipboard
Set an icon to be displayed for the neutral button.
Link copied to clipboard
Sets the callback that will be called if the dialog is canceled.
Link copied to clipboard
Sets the callback that will be called when the dialog is dismissed for any reason.
Link copied to clipboard
Sets a listener to be invoked when an item in the list is selected.
Link copied to clipboard
Sets the callback that will be called if a key is dispatched to the dialog.
Link copied to clipboard
Set a listener to be invoked when the positive button of the dialog is pressed.
Link copied to clipboard
Set an icon to be displayed for the positive button.
Link copied to clipboard
open fun setSingleChoiceItems(cursor: Cursor, checkedItem: Int, labelColumn: String, listener: DialogInterface.OnClickListener): AlertDialog.Builder
Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
Link copied to clipboard
Set the title using the given resource id.
open fun setTitle(@Nullable title: @Nullable CharSequence): AlertDialog.Builder
Set the title displayed in the Dialog.
Link copied to clipboard
Sets a custom view to be the contents of the alert dialog.
open fun setView(layoutResId: Int): AlertDialog.Builder
Inflates a custom view resource inside the dialog, below the message and above the buttons.
open fun setView(view: View, viewSpacingLeft: Int, viewSpacingTop: Int, viewSpacingRight: Int, viewSpacingBottom: Int): AlertDialog.Builder
Set a custom view to be the contents of the Dialog, specifying the spacing to appear around that view.
Link copied to clipboard
open fun show(): AlertDialog
Creates an AlertDialog with the arguments supplied to this builder and immediately displays the dialog.