java.lang.Object | ||
↳ | android.app.Dialog | |
↳ | com.htc.dialog.HtcAlertDialog |
A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. If you want to display a more complex view, look up the FrameLayout called "body" and add your view to it:
FrameLayout fl = (FrameLayout) findViewById(R.id.body); fl.add(myView, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
The AlertDialog class takes care of automatically setting
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
for you based on whether
any views in the dialog return true from View.onCheckIsTextEditor()
. Generally you want this set for a Dialog
without text editors, so that it will be placed on top of the current
input method UI. You can modify this behavior by forcing the flag to your
desired mode after calling onCreate(Bundle)
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
HtcAlertDialog.Builder | |||||||||||
HtcAlertDialog.HTC_IMERecever |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mAlert |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets one of the buttons used in the dialog.
| |||||||||||
Gets the list view used in the dialog.
| |||||||||||
Set a message to be sent when a button is pressed.
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, Message) with
BUTTON_POSITIVE .
| |||||||||||
Set a listener to be invoked when the positive button of the dialog is pressed.
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_POSITIVE
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, Message) with
BUTTON_NEGATIVE .
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_NEGATIVE
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_POSITIVE
| |||||||||||
This method is deprecated.
Use
setButton(int, CharSequence, Message) with
BUTTON_NEUTRAL .
| |||||||||||
Set resId to 0 if you don't want an icon.
| |||||||||||
Set the view to display in that dialog, specifying the spacing to appear around that
view.
| |||||||||||
Set the view to display in that dialog.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Gets one of the buttons used in the dialog.
If a button does not exist in the dialog, null will be returned.
whichButton | The identifier of the button that should be returned.
For example, this can be
BUTTON_POSITIVE . |
---|
Gets the list view used in the dialog.
ListView
from the dialog.
Set a message to be sent when a button is pressed.
whichButton | Which button to set the message for, can be one of
BUTTON_POSITIVE ,
BUTTON_NEGATIVE , or
BUTTON_NEUTRAL |
---|---|
text | The text to display in positive button. |
msg | The Message to be sent when clicked.
|
Set a listener to be invoked when the positive button of the dialog is pressed.
whichButton | Which button to set the listener on, can be one of
BUTTON_POSITIVE ,
BUTTON_NEGATIVE , or
BUTTON_NEUTRAL |
---|---|
text | The text to display in positive button. |
listener | The DialogInterface.OnClickListener to use.
|
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_POSITIVE
Set a listener to be invoked when button 1 of the dialog is pressed.
text | The text to display in button 1. |
---|---|
listener | The DialogInterface.OnClickListener to use. |
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_NEGATIVE
Set a listener to be invoked when button 2 of the dialog is pressed.
text | The text to display in button 2. |
---|---|
listener | The DialogInterface.OnClickListener to use. |
This method is deprecated.
Use
setButton(int, CharSequence, android.content.DialogInterface.OnClickListener)
with BUTTON_POSITIVE
Set a listener to be invoked when button 3 of the dialog is pressed.
text | The text to display in button 3. |
---|---|
listener | The DialogInterface.OnClickListener to use. |
Set resId to 0 if you don't want an icon.
resId | the resourceId of the drawable to use as the icon or 0 if you don't want an icon. |
---|
Set the view to display in that dialog, specifying the spacing to appear around that view.
view | The view to show in the content area of the dialog |
---|---|
viewSpacingLeft | Extra space to appear to the left of view |
viewSpacingTop | Extra space to appear above view |
viewSpacingRight | Extra space to appear to the right of view |
viewSpacingBottom | Extra space to appear below view
|