Build 1.1_r1 (from source)

android.app
Class Dialog

java.lang.Object
  extended by android.app.Dialog
All Implemented Interfaces:
DialogInterface, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback
Direct Known Subclasses:
AlertDialog, CharacterPickerDialog, SearchDialog, SoftInputWindow

public class Dialog
extends Object
implements DialogInterface, Window.Callback, KeyEvent.Callback, View.OnCreateContextMenuListener

Base class for Dialogs.

Note: Activities provide a facility to manage the creation, saving and restoring of dialogs. See Activity.onCreateDialog(int), Activity.onPrepareDialog(int, Dialog), Activity.showDialog(int), and Activity.dismissDialog(int). If these methods are used, getOwnerActivity() will return the Activity that managed this dialog.

Often you will want to have a Dialog display on top of the current input method, because there is no reason for it to accept text. You can do this by setting the WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM window flag (assuming your Dialog takes input focus, as it the default) with the following code:

     getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
             WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.content.DialogInterface
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener
 
Field Summary
protected  boolean mCancelable
          This field should be made private, so it is hidden from the SDK.
(package private)  Context mContext
           
(package private)  View mDecor
           
(package private)  Window mWindow
           
(package private)  WindowManager mWindowManager
           
 
Fields inherited from interface android.content.DialogInterface
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
 
Constructor Summary
  Dialog(Context context)
          Create a Dialog window that uses the default dialog frame style.
protected Dialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
           
protected Dialog(Context context, boolean cancelable, Message cancelCallback)
          Deprecated.  
  Dialog(Context context, int theme)
          Create a Dialog window that uses a custom dialog style.
 
Method Summary
 void addContentView(View view, ViewGroup.LayoutParams params)
          Add an additional content view to the screen.
 void cancel()
          Cancel the dialog.
 void closeOptionsMenu()
           
 void dismiss()
          Dismiss this dialog, removing it from the screen.
 boolean dispatchKeyEvent(KeyEvent event)
          Called to process key events.
(package private)  void dispatchOnCreate(Bundle savedInstanceState)
           
 boolean dispatchTouchEvent(MotionEvent ev)
          Called to process touch screen events.
 boolean dispatchTrackballEvent(MotionEvent ev)
          Called to process trackball events.
 View findViewById(int id)
          Finds a view that was identified by the id attribute from the XML that was processed in onStart().
 Context getContext()
          Retrieve the Context this Dialog is running in.
 View getCurrentFocus()
          Call Window.getCurrentFocus() on the Window if this Activity to return the currently focused view.
 LayoutInflater getLayoutInflater()
           
 Activity getOwnerActivity()
          Returns the Activity that owns this Dialog.
 int getVolumeControlStream()
           
 Window getWindow()
          Retrieve the current Window for the activity.
 void hide()
          Hide the dialog, but do not dismiss it.
 boolean isShowing()
           
 void onContentChanged()
          This hook is called whenever the content view of the screen changes (due to a call to Window.setContentView or Window.addContentView).
 boolean onContextItemSelected(MenuItem item)
           
 void onContextMenuClosed(Menu menu)
           
protected  void onCreate(Bundle savedInstanceState)
          Similar to Activity.onCreate(android.os.Bundle), you should initialized your dialog in this method, including calling setContentView(int).
 void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
          Called when the context menu for this view is being built.
 boolean onCreateOptionsMenu(Menu menu)
          It is usually safe to proxy this call to the owner activity's Activity.onCreateOptionsMenu(Menu) if the client desires the same menu for this Dialog.
 boolean onCreatePanelMenu(int featureId, Menu menu)
          Initialize the contents of the menu for panel 'featureId'.
 View onCreatePanelView(int featureId)
          Instantiate the view to display in the panel for 'featureId'.
 boolean onKeyDown(int keyCode, KeyEvent event)
          A key was pressed down.
 boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
          Default implementation of KeyEvent.Callback.onKeyMultiple(): always returns false (doesn't handle the event).
 boolean onKeyUp(int keyCode, KeyEvent event)
          A key was released.
 boolean onMenuItemSelected(int featureId, MenuItem item)
          Called when a panel's menu item has been selected by the user.
 boolean onMenuOpened(int featureId, Menu menu)
          Called when a panel's menu is opened by the user.
 boolean onOptionsItemSelected(MenuItem item)
           
 void onOptionsMenuClosed(Menu menu)
           
 void onPanelClosed(int featureId, Menu menu)
          Called when a panel is being closed.
 boolean onPrepareOptionsMenu(Menu menu)
          It is usually safe to proxy this call to the owner activity's Activity.onPrepareOptionsMenu(Menu) if the client desires the same menu for this Dialog.
 boolean onPreparePanel(int featureId, View view, Menu menu)
          Prepare a panel to be displayed.
 void onRestoreInstanceState(Bundle savedInstanceState)
          Restore the state of the dialog from a previously saved bundle.
 Bundle onSaveInstanceState()
          Saves the state of the dialog into a bundle.
 boolean onSearchRequested()
          This hook is called when the user signals the desire to start a search.
protected  void onStart()
          Called when the dialog is starting.
protected  void onStop()
          Called to tell you that you're stopping.
 boolean onTouchEvent(MotionEvent event)
          Called when a touch screen event was not handled by any of the views under it.
 boolean onTrackballEvent(MotionEvent event)
          Called when the trackball was moved and not handled by any of the views inside of the activity.
 void onWindowAttributesChanged(WindowManager.LayoutParams params)
          This is called whenever the current window attributes change.
 void onWindowFocusChanged(boolean hasFocus)
          This hook is called whenever the window focus changes.
 void openContextMenu(View view)
           
 void openOptionsMenu()
           
 void registerForContextMenu(View view)
           
 boolean requestWindowFeature(int featureId)
          Enable extended window features.
 void setCancelable(boolean flag)
          Sets whether this dialog is cancelable with the BACK key.
 void setCanceledOnTouchOutside(boolean cancel)
          Sets whether this dialog is canceled when touched outside the window's bounds.
 void setCancelMessage(Message msg)
          Set a message to be sent when the dialog is canceled.
 void setContentView(int layoutResID)
          Set the screen content from a layout resource.
 void setContentView(View view)
          Set the screen content to an explicit view.
 void setContentView(View view, ViewGroup.LayoutParams params)
          Set the screen content to an explicit view.
 void setDismissMessage(Message msg)
          Set a message to be sent when the dialog is dismissed.
 void setFeatureDrawable(int featureId, Drawable drawable)
          Convenience for calling Window.setFeatureDrawable(int, Drawable).
 void setFeatureDrawableAlpha(int featureId, int alpha)
          Convenience for calling Window.setFeatureDrawableAlpha(int, int).
 void setFeatureDrawableResource(int featureId, int resId)
          Convenience for calling Window.setFeatureDrawableResource(int, int).
 void setFeatureDrawableUri(int featureId, Uri uri)
          Convenience for calling Window.setFeatureDrawableUri(int, android.net.Uri).
 void setOnCancelListener(DialogInterface.OnCancelListener listener)
          Set a listener to be invoked when the dialog is canceled.
 void setOnDismissListener(DialogInterface.OnDismissListener listener)
          Set a listener to be invoked when the dialog is dismissed.
 void setOnKeyListener(DialogInterface.OnKeyListener onKeyListener)
          Sets the callback that will be called if a key is dispatched to the dialog.
 void setOwnerActivity(Activity activity)
          Sets the Activity that owns this dialog.
 void setTitle(CharSequence title)
          Set the title text for this dialog's window.
 void setTitle(int titleId)
          Set the title text for this dialog's window.
 void setVolumeControlStream(int streamType)
          By default, this will use the owner Activity's suggested stream type.
 void show()
          Start the dialog and display it on screen.
 void takeKeyEvents(boolean get)
          Request that key events come to this dialog.
 void unregisterForContextMenu(View view)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mContext

final Context mContext

mWindowManager

final WindowManager mWindowManager

mWindow

Window mWindow

mDecor

View mDecor

mCancelable

protected boolean mCancelable
This field should be made private, so it is hidden from the SDK.

Constructor Detail

Dialog

public Dialog(Context context)
Create a Dialog window that uses the default dialog frame style.

Parameters:
context - The Context the Dialog is to run it. In particular, it uses the window manager and theme in this context to present its UI.

Dialog

public Dialog(Context context,
              int theme)
Create a Dialog window that uses a custom dialog style.

Parameters:
context - The Context in which the Dialog should run. In particular, it uses the window manager and theme from this context to present its UI.
theme - A style resource describing the theme to use for the window. See Style and Theme Resources for more information about defining and using styles. This theme is applied on top of the current theme in context. If 0, the default dialog theme will be used.

Dialog

@Deprecated
protected Dialog(Context context,
                            boolean cancelable,
                            Message cancelCallback)
Deprecated. 


Dialog

protected Dialog(Context context,
                 boolean cancelable,
                 DialogInterface.OnCancelListener cancelListener)
Method Detail

getContext

public final Context getContext()
Retrieve the Context this Dialog is running in.

Returns:
Context The Context that was supplied to the constructor.

setOwnerActivity

public final void setOwnerActivity(Activity activity)
Sets the Activity that owns this dialog. An example use: This Dialog will use the suggested volume control stream of the Activity.

Parameters:
activity - The Activity that owns this dialog.

getOwnerActivity

public final Activity getOwnerActivity()
Returns the Activity that owns this Dialog. For example, if Activity.showDialog(int) is used to show this Dialog, that Activity will be the owner (by default). Depending on how this dialog was created, this may return null.

Returns:
The Activity that owns this Dialog.

isShowing

public boolean isShowing()
Returns:
Whether the dialog is currently showing.

show

public void show()
Start the dialog and display it on screen. The window is placed in the application layer and opaque. Note that you should not override this method to do initialization when the dialog is shown, instead implement that in onStart().


hide

public void hide()
Hide the dialog, but do not dismiss it.


dismiss

public void dismiss()
Dismiss this dialog, removing it from the screen. This method can be invoked safely from any thread. Note that you should not override this method to do cleanup when the dialog is dismissed, instead implement that in onStop().

Specified by:
dismiss in interface DialogInterface

dispatchOnCreate

void dispatchOnCreate(Bundle savedInstanceState)

onCreate

protected void onCreate(Bundle savedInstanceState)
Similar to Activity.onCreate(android.os.Bundle), you should initialized your dialog in this method, including calling setContentView(int).

Parameters:
savedInstanceState - If this dialog is being reinitalized after a the hosting activity was previously shut down, holds the result from the most recent call to onSaveInstanceState(), or null if this is the first time.

onStart

protected void onStart()
Called when the dialog is starting.


onStop

protected void onStop()
Called to tell you that you're stopping.


onSaveInstanceState

public Bundle onSaveInstanceState()
Saves the state of the dialog into a bundle. The default implementation saves the state of its view hierarchy, so you'll likely want to call through to super if you override this to save additional state.

Returns:
A bundle with the state of the dialog.

onRestoreInstanceState

public void onRestoreInstanceState(Bundle savedInstanceState)
Restore the state of the dialog from a previously saved bundle. The default implementation restores the state of the dialog's view hierarchy that was saved in the default implementation of onSaveInstanceState(), so be sure to call through to super when overriding unless you want to do all restoring of state yourself.

Parameters:
savedInstanceState - The state of the dialog previously saved by onSaveInstanceState().

getWindow

public Window getWindow()
Retrieve the current Window for the activity. This can be used to directly access parts of the Window API that are not available through Activity/Screen.

Returns:
Window The current window, or null if the activity is not visual.

getCurrentFocus

public View getCurrentFocus()
Call Window.getCurrentFocus() on the Window if this Activity to return the currently focused view.

Returns:
View The current View with focus or null.
See Also:
getWindow(), Window.getCurrentFocus()

findViewById

public View findViewById(int id)
Finds a view that was identified by the id attribute from the XML that was processed in onStart().

Parameters:
id - the identifier of the view to find
Returns:
The view if found or null otherwise.

setContentView

public void setContentView(int layoutResID)
Set the screen content from a layout resource. The resource will be inflated, adding all top-level views to the screen.

Parameters:
layoutResID - Resource ID to be inflated.

setContentView

public void setContentView(View view)
Set the screen content to an explicit view. This view is placed directly into the screen's view hierarchy. It can itself be a complex view hierarhcy.

Parameters:
view - The desired content to display.

setContentView

public void setContentView(View view,
                           ViewGroup.LayoutParams params)
Set the screen content to an explicit view. This view is placed directly into the screen's view hierarchy. It can itself be a complex view hierarhcy.

Parameters:
view - The desired content to display.
params - Layout parameters for the view.

addContentView

public void addContentView(View view,
                           ViewGroup.LayoutParams params)
Add an additional content view to the screen. Added after any existing ones in the screen -- existing views are NOT removed.

Parameters:
view - The desired content to display.
params - Layout parameters for the view.

setTitle

public void setTitle(CharSequence title)
Set the title text for this dialog's window.

Parameters:
title - The new text to display in the title.

setTitle

public void setTitle(int titleId)
Set the title text for this dialog's window. The text is retrieved from the resources with the supplied identifier.

Parameters:
titleId - the title's text resource identifier

onKeyDown

public boolean onKeyDown(int keyCode,
                         KeyEvent event)
A key was pressed down.

If the focused view didn't want this event, this method is called.

The default implementation handles KEYCODE_BACK to close the dialog.

Specified by:
onKeyDown in interface KeyEvent.Callback
Parameters:
keyCode - The value in event.getKeyCode().
event - Description of the key event.
Returns:
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.
See Also:
onKeyUp(int, android.view.KeyEvent), KeyEvent

onKeyUp

public boolean onKeyUp(int keyCode,
                       KeyEvent event)
A key was released.

Specified by:
onKeyUp in interface KeyEvent.Callback
Parameters:
keyCode - The value in event.getKeyCode().
event - Description of the key event.
Returns:
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.
See Also:
onKeyDown(int, android.view.KeyEvent), KeyEvent

onKeyMultiple

public boolean onKeyMultiple(int keyCode,
                             int repeatCount,
                             KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyMultiple(): always returns false (doesn't handle the event).

Specified by:
onKeyMultiple in interface KeyEvent.Callback
Parameters:
keyCode - The value in event.getKeyCode().
repeatCount - Number of pairs as returned by event.getRepeatCount().
event - Description of the key event.
Returns:
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

onTouchEvent

public boolean onTouchEvent(MotionEvent event)
Called when a touch screen event was not handled by any of the views under it. This is most useful to process touch events that happen outside of your window bounds, where there is no view to receive it.

Parameters:
event - The touch screen event being processed.
Returns:
Return true if you have consumed the event, false if you haven't. The default implementation will cancel the dialog when a touch happens outside of the window bounds.

onTrackballEvent

public boolean onTrackballEvent(MotionEvent event)
Called when the trackball was moved and not handled by any of the views inside of the activity. So, for example, if the trackball moves while focus is on a button, you will receive a call here because buttons do not normally do anything with trackball events. The call here happens before trackball movements are converted to DPAD key events, which then get sent back to the view hierarchy, and will be processed at the point for things like focus navigation.

Parameters:
event - The trackball event being processed.
Returns:
Return true if you have consumed the event, false if you haven't. The default implementation always returns false.

onWindowAttributesChanged

public void onWindowAttributesChanged(WindowManager.LayoutParams params)
Description copied from interface: Window.Callback
This is called whenever the current window attributes change.

Specified by:
onWindowAttributesChanged in interface Window.Callback

onContentChanged

public void onContentChanged()
Description copied from interface: Window.Callback
This hook is called whenever the content view of the screen changes (due to a call to Window.setContentView or Window.addContentView).

Specified by:
onContentChanged in interface Window.Callback

onWindowFocusChanged

public void onWindowFocusChanged(boolean hasFocus)
Description copied from interface: Window.Callback
This hook is called whenever the window focus changes.

Specified by:
onWindowFocusChanged in interface Window.Callback
Parameters:
hasFocus - Whether the window now has focus.

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent event)
Called to process key events. You can override this to intercept all key events before they are dispatched to the window. Be sure to call this implementation for key events that should be handled normally.

Specified by:
dispatchKeyEvent in interface Window.Callback
Parameters:
event - The key event.
Returns:
boolean Return true if this event was consumed.

dispatchTouchEvent

public boolean dispatchTouchEvent(MotionEvent ev)
Called to process touch screen events. You can override this to intercept all touch screen events before they are dispatched to the window. Be sure to call this implementation for touch screen events that should be handled normally.

Specified by:
dispatchTouchEvent in interface Window.Callback
Parameters:
ev - The touch screen event.
Returns:
boolean Return true if this event was consumed.

dispatchTrackballEvent

public boolean dispatchTrackballEvent(MotionEvent ev)
Called to process trackball events. You can override this to intercept all trackball events before they are dispatched to the window. Be sure to call this implementation for trackball events that should be handled normally.

Specified by:
dispatchTrackballEvent in interface Window.Callback
Parameters:
ev - The trackball event.
Returns:
boolean Return true if this event was consumed.

onCreatePanelView

public View onCreatePanelView(int featureId)
Description copied from interface: Window.Callback
Instantiate the view to display in the panel for 'featureId'. You can return null, in which case the default content (typically a menu) will be created for you.

Specified by:
onCreatePanelView in interface Window.Callback
Parameters:
featureId - Which panel is being created.
Returns:
view The top-level view to place in the panel.
See Also:
Activity.onCreatePanelView(int)

onCreatePanelMenu

public boolean onCreatePanelMenu(int featureId,
                                 Menu menu)
Description copied from interface: Window.Callback
Initialize the contents of the menu for panel 'featureId'. This is called if onCreatePanelView() returns null, giving you a standard menu in which you can place your items. It is only called once for the panel, the first time it is shown.

You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreatePanelMenu() is called for this feature.

Specified by:
onCreatePanelMenu in interface Window.Callback
Parameters:
featureId - The panel being created.
menu - The menu inside the panel.
Returns:
boolean You must return true for the panel to be displayed; if you return false it will not be shown.
See Also:
Activity.onCreatePanelMenu(int, Menu)

onPreparePanel

public boolean onPreparePanel(int featureId,
                              View view,
                              Menu menu)
Description copied from interface: Window.Callback
Prepare a panel to be displayed. This is called right before the panel window is shown, every time it is shown.

Specified by:
onPreparePanel in interface Window.Callback
Parameters:
featureId - The panel that is being displayed.
view - The View that was returned by onCreatePanelView().
menu - If onCreatePanelView() returned null, this is the Menu being displayed in the panel.
Returns:
boolean You must return true for the panel to be displayed; if you return false it will not be shown.
See Also:
Activity.onPreparePanel(int, View, Menu)

onMenuOpened

public boolean onMenuOpened(int featureId,
                            Menu menu)
Description copied from interface: Window.Callback
Called when a panel's menu is opened by the user. This may also be called when the menu is changing from one type to another (for example, from the icon menu to the expanded menu).

Specified by:
onMenuOpened in interface Window.Callback
Parameters:
featureId - The panel that the menu is in.
menu - The menu that is opened.
Returns:
Return true to allow the menu to open, or false to prevent the menu from opening.
See Also:
Activity.onMenuOpened(int, Menu)

onMenuItemSelected

public boolean onMenuItemSelected(int featureId,
                                  MenuItem item)
Description copied from interface: Window.Callback
Called when a panel's menu item has been selected by the user.

Specified by:
onMenuItemSelected in interface Window.Callback
Parameters:
featureId - The panel that the menu is in.
item - The menu item that was selected.
Returns:
boolean Return true to finish processing of selection, or false to perform the normal menu handling (calling its Runnable or sending a Message to its target Handler).
See Also:
Activity.onMenuItemSelected(int, MenuItem)

onPanelClosed

public void onPanelClosed(int featureId,
                          Menu menu)
Description copied from interface: Window.Callback
Called when a panel is being closed. If another logical subsequent panel is being opened (and this panel is being closed to make room for the subsequent panel), this method will NOT be called.

Specified by:
onPanelClosed in interface Window.Callback
Parameters:
featureId - The panel that is being displayed.
menu - If onCreatePanelView() returned null, this is the Menu being displayed in the panel.
See Also:
Activity.onPanelClosed(int, Menu)

onCreateOptionsMenu

public boolean onCreateOptionsMenu(Menu menu)
It is usually safe to proxy this call to the owner activity's Activity.onCreateOptionsMenu(Menu) if the client desires the same menu for this Dialog.

See Also:
Activity.onCreateOptionsMenu(Menu), getOwnerActivity()

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)
It is usually safe to proxy this call to the owner activity's Activity.onPrepareOptionsMenu(Menu) if the client desires the same menu for this Dialog.

See Also:
Activity.onPrepareOptionsMenu(Menu), getOwnerActivity()

onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
See Also:
Activity.onOptionsItemSelected(MenuItem)

onOptionsMenuClosed

public void onOptionsMenuClosed(Menu menu)
See Also:
Activity.onOptionsMenuClosed(Menu)

openOptionsMenu

public void openOptionsMenu()
See Also:
Activity.openOptionsMenu()

closeOptionsMenu

public void closeOptionsMenu()
See Also:
Activity.closeOptionsMenu()

onCreateContextMenu

public void onCreateContextMenu(ContextMenu menu,
                                View v,
                                ContextMenu.ContextMenuInfo menuInfo)
Description copied from interface: View.OnCreateContextMenuListener
Called when the context menu for this view is being built. It is not safe to hold onto the menu after this method returns.

Specified by:
onCreateContextMenu in interface View.OnCreateContextMenuListener
Parameters:
menu - The context menu that is being built
v - The view for which the context menu is being built
menuInfo - Extra information about the item for which the context menu should be shown. This information will vary depending on the class of v.
See Also:
Activity#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)

registerForContextMenu

public void registerForContextMenu(View view)
See Also:
Activity.registerForContextMenu(View)

unregisterForContextMenu

public void unregisterForContextMenu(View view)
See Also:
Activity.unregisterForContextMenu(View)

openContextMenu

public void openContextMenu(View view)
See Also:
Activity.openContextMenu(View)

onContextItemSelected

public boolean onContextItemSelected(MenuItem item)
See Also:
Activity.onContextItemSelected(MenuItem)

onContextMenuClosed

public void onContextMenuClosed(Menu menu)
See Also:
Activity.onContextMenuClosed(Menu)

onSearchRequested

public boolean onSearchRequested()
This hook is called when the user signals the desire to start a search.

Specified by:
onSearchRequested in interface Window.Callback
Returns:
true if search launched, false if activity refuses (blocks)
See Also:
Activity.onSearchRequested()

takeKeyEvents

public void takeKeyEvents(boolean get)
Request that key events come to this dialog. Use this if your dialog has no views with focus, but the dialog still wants a chance to process key events.

Parameters:
get - true if the dialog should receive key events, false otherwise
See Also:
Window.takeKeyEvents(boolean)

requestWindowFeature

public final boolean requestWindowFeature(int featureId)
Enable extended window features. This is a convenience for calling getWindow().requestFeature().

Parameters:
featureId - The desired feature as defined in Window.
Returns:
Returns true if the requested feature is supported and now enabled.
See Also:
Window.requestFeature(int)

setFeatureDrawableResource

public final void setFeatureDrawableResource(int featureId,
                                             int resId)
Convenience for calling Window.setFeatureDrawableResource(int, int).


setFeatureDrawableUri

public final void setFeatureDrawableUri(int featureId,
                                        Uri uri)
Convenience for calling Window.setFeatureDrawableUri(int, android.net.Uri).


setFeatureDrawable

public final void setFeatureDrawable(int featureId,
                                     Drawable drawable)
Convenience for calling Window.setFeatureDrawable(int, Drawable).


setFeatureDrawableAlpha

public final void setFeatureDrawableAlpha(int featureId,
                                          int alpha)
Convenience for calling Window.setFeatureDrawableAlpha(int, int).


getLayoutInflater

public LayoutInflater getLayoutInflater()

setCancelable

public void setCancelable(boolean flag)
Sets whether this dialog is cancelable with the BACK key.


setCanceledOnTouchOutside

public void setCanceledOnTouchOutside(boolean cancel)
Sets whether this dialog is canceled when touched outside the window's bounds. If setting to true, the dialog is set to be cancelable if not already set.

Parameters:
cancel - Whether the dialog should be canceled when touched outside the window.

cancel

public void cancel()
Cancel the dialog. This is essentially the same as calling dismiss(), but it will also call your DialogInterface.OnCancelListener (if registered).

Specified by:
cancel in interface DialogInterface

setOnCancelListener

public void setOnCancelListener(DialogInterface.OnCancelListener listener)
Set a listener to be invoked when the dialog is canceled.

This will only be invoked when the dialog is canceled, if the creator needs to know when it is dismissed in general, use setOnDismissListener(android.content.DialogInterface.OnDismissListener).

Parameters:
listener - The DialogInterface.OnCancelListener to use.

setCancelMessage

public void setCancelMessage(Message msg)
Set a message to be sent when the dialog is canceled.

Parameters:
msg - The msg to send when the dialog is canceled.
See Also:
setOnCancelListener(android.content.DialogInterface.OnCancelListener)

setOnDismissListener

public void setOnDismissListener(DialogInterface.OnDismissListener listener)
Set a listener to be invoked when the dialog is dismissed.

Parameters:
listener - The DialogInterface.OnDismissListener to use.

setDismissMessage

public void setDismissMessage(Message msg)
Set a message to be sent when the dialog is dismissed.

Parameters:
msg - The msg to send when the dialog is dismissed.

setVolumeControlStream

public final void setVolumeControlStream(int streamType)
By default, this will use the owner Activity's suggested stream type.

See Also:
Activity.setVolumeControlStream(int), setOwnerActivity(Activity)

getVolumeControlStream

public final int getVolumeControlStream()
See Also:
Activity.getVolumeControlStream()

setOnKeyListener

public void setOnKeyListener(DialogInterface.OnKeyListener onKeyListener)
Sets the callback that will be called if a key is dispatched to the dialog.


Build 1.1_r1 (from source)

Please submit a feedback, bug or feature