android.app
public
static
class
android.app.AlertDialog.Builder
Summary
Public Constructors
Public Methods
|
|
|
|
|
AlertDialog |
create() |
|
|
|
|
|
AlertDialog.Builder |
setAdapter(ListAdapter adapter, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setCancelable(boolean cancelable) |
|
|
|
|
|
AlertDialog.Builder |
setCursor(Cursor cursor, DialogInterface.OnClickListener listener, String labelColumn) |
|
|
|
|
|
AlertDialog.Builder |
setCustomTitle(View customTitleView) |
|
|
|
|
|
AlertDialog.Builder |
setIcon(Drawable icon) |
|
|
|
|
|
AlertDialog.Builder |
setIcon(int iconId) |
|
|
|
|
|
AlertDialog.Builder |
setInverseBackgroundForced(boolean useInverseBackground) |
|
|
|
|
|
AlertDialog.Builder |
setItems(int itemsId, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setItems(CharSequence[] items, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setMessage(int messageId) |
|
|
|
|
|
AlertDialog.Builder |
setMessage(CharSequence message) |
|
|
|
|
|
AlertDialog.Builder |
setMultiChoiceItems(Cursor cursor, String isCheckedColumn, String labelColumn, DialogInterface.OnMultiChoiceClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setMultiChoiceItems(int itemsId, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setMultiChoiceItems(CharSequence[] items, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setNegativeButton(CharSequence text, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setNegativeButton(int textId, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setNeutralButton(int textId, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setNeutralButton(CharSequence text, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setOnCancelListener(DialogInterface.OnCancelListener onCancelListener) |
|
|
|
|
|
AlertDialog.Builder |
setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setOnKeyListener(DialogInterface.OnKeyListener onKeyListener) |
|
|
|
|
|
AlertDialog.Builder |
setPositiveButton(CharSequence text, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setPositiveButton(int textId, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setSingleChoiceItems(int itemsId, int checkedItem, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setSingleChoiceItems(CharSequence[] items, int checkedItem, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setSingleChoiceItems(ListAdapter adapter, int checkedItem, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setSingleChoiceItems(Cursor cursor, int checkedItem, String labelColumn, DialogInterface.OnClickListener listener) |
|
|
|
|
|
AlertDialog.Builder |
setTitle(int titleId) |
|
|
|
|
|
AlertDialog.Builder |
setTitle(CharSequence title) |
|
|
|
|
|
AlertDialog.Builder |
setView(View view) |
|
|
|
|
|
AlertDialog |
show() |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
AlertDialog.Builder(Context context)
Constructor using a context for this builder and the
AlertDialog it creates.
Public Methods
Creates a
AlertDialog with the arguments supplied to this builder. It does not
show() the dialog. This allows the user to do any extra processing
before displaying the dialog. Use
show() if you don't have any other processing
to do and want this to be created and displayed.
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.
Parameters
adapter
| The ListAdapter to supply the list of items |
listener
| The listener that will be called when an item is clicked.
|
public
AlertDialog.Builder
setCancelable(boolean cancelable)
Sets whether the dialog is cancelable or not default is true.
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.
Parameters
cursor
| The Cursor to supply the list of items |
listener
| The listener that will be called when an item is clicked. |
labelColumn
| The column name on the cursor containing the string to display
in the label.
|
Set the title using the custom view
customTitleView
. The
methods
setTitle(int) and
setIcon(int) should be
sufficient for most titles, but this is provided if the title needs
more customization. Using this will replace the title and icon set
via the other methods.
Parameters
customTitleView
| The custom view to use as the title.
|
Set the
Drawable to be used in the title.
Set the resource id of the
Drawable to be used in the title.
public
AlertDialog.Builder
setInverseBackgroundForced(boolean useInverseBackground)
Sets the Dialog to use the inverse background, regardless of what the
contents is.
Parameters
useInverseBackground
| Whether to use the inverse background |
Returns
- This Builder object to allow for chaining of sets.
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. This should be an array type i.e. R.array.foo
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.
Set the message to display using the given resource id.
Set the message to display.
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.
The list will have a check mark displayed to the right of the text
for each checked item. Clicking on an item in the list will not
dismiss the dialog. Clicking on a button will dismiss the dialog.
Parameters
cursor
| the cursor used to provide the items. |
isCheckedColumn
| specifies the column name on the cursor to use to determine
whether a checkbox is checked or not. It must return an integer value where 1
means checked and 0 means unchecked. |
labelColumn
| The column name on the cursor containing the string to display in the
label. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
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.
This should be an array type, e.g. R.array.foo. The list will have
a check mark displayed to the right of the text for each checked
item. Clicking on an item in the list will not dismiss the dialog.
Clicking on a button will dismiss the dialog.
Parameters
itemsId
| the resource id of an array i.e. R.array.foo |
checkedItems
| specifies which items are checked. It should be null in which case no
items are checked. If non null it must be exactly the same length as the array of
items. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
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.
The list will have a check mark displayed to the right of the text
for each checked item. Clicking on an item in the list will not
dismiss the dialog. Clicking on a button will dismiss the dialog.
Parameters
items
| the text of the items to be displayed in the list. |
checkedItems
| specifies which items are checked. It should be null in which case no
items are checked. If non null it must be exactly the same length as the array of
items. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
Set a listener to be invoked when the negative button of the dialog is pressed.
Set a listener to be invoked when the negative button of the dialog is pressed.
Set a listener to be invoked when the neutral button of the dialog is pressed.
Set a listener to be invoked when the neutral button of the dialog is pressed.
Sets the callback that will be called if the dialog is canceled.
Sets a listener to be invoked when an item in the list is selected.
Parameters
listener
| The listener to be invoked. |
Sets the callback that will be called if a key is dispatched to the dialog.
Set a listener to be invoked when the positive button of the dialog is pressed.
Set a listener to be invoked when the positive button of the dialog is pressed.
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. This should be an array type i.e.
R.array.foo The list will have a check mark displayed to the right of the text for the
checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a
button will dismiss the dialog.
Parameters
itemsId
| the resource id of an array i.e. R.array.foo |
checkedItem
| specifies which item is checked. If -1 no items are checked. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
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. The list will have a check mark displayed to
the right of the text for the checked item. Clicking on an item in the list will not
dismiss the dialog. Clicking on a button will dismiss the dialog.
Parameters
items
| the items to be displayed. |
checkedItem
| specifies which item is checked. If -1 no items are checked. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
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. The list will have a check mark displayed to
the right of the text for the checked item. Clicking on an item in the list will not
dismiss the dialog. Clicking on a button will dismiss the dialog.
Parameters
adapter
| The ListAdapter to supply the list of items |
checkedItem
| specifies which item is checked. If -1 no items are checked. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
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. The list will have a check mark displayed to
the right of the text for the checked item. Clicking on an item in the list will not
dismiss the dialog. Clicking on a button will dismiss the dialog.
Parameters
cursor
| the cursor to retrieve the items from. |
checkedItem
| specifies which item is checked. If -1 no items are checked. |
labelColumn
| The column name on the cursor containing the string to display in the
label. |
listener
| notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, if no buttons are supplied it's up to the user to dismiss the dialog.
|
Set the title using the given resource id.
Set the title displayed in the
Dialog.
Set a custom view to be the contents of the Dialog. If the supplied view is an instance
of a
ListView the light background will be used.
Creates a
AlertDialog with the arguments supplied to this builder and
show()'s the dialog.