/**@class android.app.Dialog implements android.content.DialogInterface implements android.view.Window.Callback implements android.view.KeyEvent.Callback implements android.view.View.OnCreateContextMenuListener implements android.view.Window.OnWindowDismissedCallback @extends java.lang.Object Base class for Dialogs. <p>Note: Activities provide a facility to manage the creation, saving and restoring of dialogs. See {@link android.app.Activity#onCreateDialog(int)}, {@link android.app.Activity#onPrepareDialog(int, Dialog)}, {@link android.app.Activity#showDialog(int)}, and {@link android.app.Activity#dismissDialog(int)}. If these methods are used, {@link #getOwnerActivity}() will return the Activity that managed this dialog. <p>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 {@link WindowManager.LayoutParams#FLAG_ALT_FOCUSABLE_IM WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM} window flag (assuming your Dialog takes input focus, as it the default) with the following code: <pre> getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);</pre> <div class="special reference"> <h3>Developer Guides</h3> <p>For more information about creating dialogs, read the <a href="{@docRoot}guide/topics/ui/dialogs.html">Dialogs</a> developer guide.</p> </div> */ var Dialog = { /**Retrieve the Context this Dialog is running in. @return {Object {android.content.Context}} Context The Context used by the Dialog. */ getContext : function( ) {}, /**Retrieve the {@link android.app.ActionBar} attached to this dialog, if present. @return {Object {android.app.ActionBar}} The ActionBar attached to the dialog or null if no ActionBar is present. */ getActionBar : function( ) {}, /**Sets the Activity that owns this dialog. An example use: This Dialog will use the suggested volume control stream of the Activity. @param {Object {Activity}} activity The Activity that owns this dialog. */ setOwnerActivity : function( ) {}, /**Returns the Activity that owns this Dialog. For example, if {@link android.app.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. @return {Object {android.app.Activity}} The Activity that owns this Dialog. */ getOwnerActivity : function( ) {}, /** @return {Boolean} Whether the dialog is currently showing. */ isShowing : function( ) {}, /**Forces immediate creation of the dialog. <p> Note that you should not override this method to perform dialog creation. Rather, override {@link #onCreate}(Bundle). */ create : function( ) {}, /**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 {@link #onStart}. */ show : function( ) {}, /**Hide the dialog, but do not dismiss it. */ hide : function( ) {}, /**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 {@link #onStop}. */ dismiss : function( ) {}, /**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. @return {Object {android.os.Bundle}} A bundle with the state of the dialog. */ onSaveInstanceState : function( ) {}, /**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 {@link #onSaveInstanceState}(), so be sure to call through to super when overriding unless you want to do all restoring of state yourself. @param {Object {Bundle}} savedInstanceState The state of the dialog previously saved by {@link #onSaveInstanceState()}. */ onRestoreInstanceState : function( ) {}, /**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. @return {Object {android.view.Window}} Window The current window, or null if the activity is not visual. */ getWindow : function( ) {}, /**Call {@link android.view.Window#getCurrentFocus} on the Window if this Activity to return the currently focused view. @return {Object {android.view.View}} View The current View with focus or null. @see #getWindow @see android.view.Window#getCurrentFocus */ getCurrentFocus : function( ) {}, /**Finds the first descendant view with the given ID or {@code null} if the ID is invalid (< 0), there is no matching view in the hierarchy, or the dialog has not yet been fully created (for example, via {@link #show}() or {@link #create}()). <p> <strong>Note:</strong> In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary. @param {Number} id the ID to search for @return {Object {android.view.View}} a view with given ID if found, or {@code null} otherwise @see View#findViewById(int) @see Dialog#requireViewById(int) */ findViewById : function( ) {}, /**Finds the first descendant view with the given ID or throws an IllegalArgumentException if the ID is invalid (< 0), there is no matching view in the hierarchy, or the dialog has not yet been fully created (for example, via {@link #show}() or {@link #create}()). <p> <strong>Note:</strong> In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary. @param {Number} id the ID to search for @return {Object {android.view.View}} a view with given ID @see View#requireViewById(int) @see Dialog#findViewById(int) */ requireViewById : function( ) {}, /**Set the screen content from a layout resource. The resource will be inflated, adding all top-level views to the screen. @param {Number} layoutResID Resource ID to be inflated. */ setContentView : function( ) {}, /**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 hierarchy. @param {Object {View}} view The desired content to display. */ setContentView : function( ) {}, /**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 hierarchy. @param {Object {View}} view The desired content to display. @param {Object {ViewGroup.LayoutParams}} params Layout parameters for the view. */ setContentView : function( ) {}, /**Add an additional content view to the screen. Added after any existing ones in the screen -- existing views are NOT removed. @param {Object {View}} view The desired content to display. @param {Object {ViewGroup.LayoutParams}} params Layout parameters for the view. */ addContentView : function( ) {}, /**Set the title text for this dialog's window. @param {Object {CharSequence}} title The new text to display in the title. */ setTitle : function( ) {}, /**Set the title text for this dialog's window. The text is retrieved from the resources with the supplied identifier. @param {Number} titleId the title's text resource identifier */ setTitle : function( ) {}, /**A key was pressed down. <p> If the focused view didn't want this event, this method is called. <p> Default implementation consumes {@link KeyEvent#KEYCODE_BACK KEYCODE_BACK} and, as of {@link android.os.Build.VERSION_CODES#P P}, {@link KeyEvent#KEYCODE_ESCAPE KEYCODE_ESCAPE} to later handle them in {@link #onKeyUp}. @see #onKeyUp @see android.view.KeyEvent */ onKeyDown : function( ) {}, /**Default implementation of {@link KeyEvent.Callback#onKeyLongPress(int, KeyEvent) KeyEvent.Callback.onKeyLongPress()}: always returns false (doesn't handle the event). */ onKeyLongPress : function( ) {}, /**A key was released. <p> Default implementation consumes {@link KeyEvent#KEYCODE_BACK KEYCODE_BACK} and, as of {@link android.os.Build.VERSION_CODES#P P}, {@link KeyEvent#KEYCODE_ESCAPE KEYCODE_ESCAPE} to close the dialog. @see #onKeyDown @see android.view.KeyEvent */ onKeyUp : function( ) {}, /**Default implementation of {@link KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) KeyEvent.Callback.onKeyMultiple()}: always returns false (doesn't handle the event). */ onKeyMultiple : function( ) {}, /**Called when the dialog has detected the user's press of the back key. The default implementation simply cancels the dialog (only if it is cancelable), but you can override this to do whatever you want. */ onBackPressed : function( ) {}, /**Called when a key shortcut event is not handled by any of the views in the Dialog. Override this method to implement global key shortcuts for the Dialog. Key shortcuts can also be implemented by setting the {@link MenuItem#setShortcut(char, char) shortcut} property of menu items. @param {Number} keyCode The value in event.getKeyCode(). @param {Object {KeyEvent}} event Description of the key event. @return {Boolean} True if the key shortcut was handled. */ onKeyShortcut : function( ) {}, /**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. @param {Object {MotionEvent}} event The touch screen event being processed. @return {Boolean} 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. */ onTouchEvent : function( ) {}, /**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 <em>before</em> 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. @param {Object {MotionEvent}} event The trackball event being processed. @return {Boolean} Return true if you have consumed the event, false if you haven't. The default implementation always returns false. */ onTrackballEvent : function( ) {}, /**Called when a generic motion event was not handled by any of the views inside of the dialog. <p> Generic motion events describe joystick movements, mouse hovers, track pad touches, scroll wheel movements and other input events. The {@link MotionEvent#getSource() source} of the motion event specifies the class of input that was received. Implementations of this method must examine the bits in the source before processing the event. The following code example shows how this is done. </p><p> Generic motion events with source class {@link android.view.InputDevice#SOURCE_CLASS_POINTER} are delivered to the view under the pointer. All other generic motion events are delivered to the focused view. </p><p> See {@link View#onGenericMotionEvent(MotionEvent)} for an example of how to handle this event. </p> @param {Object {MotionEvent}} event The generic motion event being processed. @return {Boolean} Return true if you have consumed the event, false if you haven't. The default implementation always returns false. */ onGenericMotionEvent : function( ) {}, /** */ onWindowAttributesChanged : function( ) {}, /** */ onContentChanged : function( ) {}, /** */ onWindowFocusChanged : function( ) {}, /** */ onAttachedToWindow : function( ) {}, /** */ onDetachedFromWindow : function( ) {}, /** @hide */ onWindowDismissed : function( ) {}, /**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. @param {Object {KeyEvent}} event The key event. @return {Boolean} boolean Return true if this event was consumed. */ dispatchKeyEvent : function( ) {}, /**Called to process a key shortcut event. You can override this to intercept all key shortcut events before they are dispatched to the window. Be sure to call this implementation for key shortcut events that should be handled normally. @param {Object {KeyEvent}} event The key shortcut event. @return {Boolean} True if this event was consumed. */ dispatchKeyShortcutEvent : function( ) {}, /**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. @param {Object {MotionEvent}} ev The touch screen event. @return {Boolean} boolean Return true if this event was consumed. */ dispatchTouchEvent : function( ) {}, /**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. @param {Object {MotionEvent}} ev The trackball event. @return {Boolean} boolean Return true if this event was consumed. */ dispatchTrackballEvent : function( ) {}, /**Called to process generic motion events. You can override this to intercept all generic motion events before they are dispatched to the window. Be sure to call this implementation for generic motion events that should be handled normally. @param {Object {MotionEvent}} ev The generic motion event. @return {Boolean} boolean Return true if this event was consumed. */ dispatchGenericMotionEvent : function( ) {}, /** */ dispatchPopulateAccessibilityEvent : function( ) {}, /** @see Activity#onCreatePanelView(int) */ onCreatePanelView : function( ) {}, /** @see Activity#onCreatePanelMenu(int, Menu) */ onCreatePanelMenu : function( ) {}, /** @see Activity#onPreparePanel(int, View, Menu) */ onPreparePanel : function( ) {}, /** @see Activity#onMenuOpened(int, Menu) */ onMenuOpened : function( ) {}, /** @see Activity#onMenuItemSelected(int, MenuItem) */ onMenuItemSelected : function( ) {}, /** @see Activity#onPanelClosed(int, Menu) */ onPanelClosed : function( ) {}, /**It is usually safe to proxy this call to the owner activity's {@link android.app.Activity#onCreateOptionsMenu(Menu)} if the client desires the same menu for this Dialog. @see Activity#onCreateOptionsMenu(Menu) @see #getOwnerActivity() */ onCreateOptionsMenu : function( ) {}, /**It is usually safe to proxy this call to the owner activity's {@link android.app.Activity#onPrepareOptionsMenu(Menu)} if the client desires the same menu for this Dialog. @see Activity#onPrepareOptionsMenu(Menu) @see #getOwnerActivity() */ onPrepareOptionsMenu : function( ) {}, /** @see Activity#onOptionsItemSelected(MenuItem) */ onOptionsItemSelected : function( ) {}, /** @see Activity#onOptionsMenuClosed(Menu) */ onOptionsMenuClosed : function( ) {}, /** @see Activity#openOptionsMenu() */ openOptionsMenu : function( ) {}, /** @see Activity#closeOptionsMenu() */ closeOptionsMenu : function( ) {}, /** @see Activity#invalidateOptionsMenu() */ invalidateOptionsMenu : function( ) {}, /** @see Activity#onCreateContextMenu(ContextMenu, View, ContextMenuInfo) */ onCreateContextMenu : function( ) {}, /** @see Activity#registerForContextMenu(View) */ registerForContextMenu : function( ) {}, /** @see Activity#unregisterForContextMenu(View) */ unregisterForContextMenu : function( ) {}, /** @see Activity#openContextMenu(View) */ openContextMenu : function( ) {}, /** @see Activity#onContextItemSelected(MenuItem) */ onContextItemSelected : function( ) {}, /** @see Activity#onContextMenuClosed(Menu) */ onContextMenuClosed : function( ) {}, /**This hook is called when the user signals the desire to start a search. */ onSearchRequested : function( ) {}, /**This hook is called when the user signals the desire to start a search. */ onSearchRequested : function( ) {}, /**During the onSearchRequested() callbacks, this function will return the {@link SearchEvent} that triggered the callback, if it exists. @return {Object {android.view.SearchEvent}} SearchEvent The SearchEvent that triggered the {@link #onSearchRequested} callback. */ getSearchEvent : function( ) {}, /** */ onWindowStartingActionMode : function( ) {}, /** */ onWindowStartingActionMode : function( ) {}, /**{@inheritDoc} Note that if you override this method you should always call through to the superclass implementation by calling super.onActionModeStarted(mode). */ onActionModeStarted : function( ) {}, /**{@inheritDoc} Note that if you override this method you should always call through to the superclass implementation by calling super.onActionModeFinished(mode). */ onActionModeFinished : function( ) {}, /**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. @param {Boolean} get true if the dialog should receive key events, false otherwise @see android.view.Window#takeKeyEvents */ takeKeyEvents : function( ) {}, /**Enable extended window features. This is a convenience for calling {@link android.view.Window#requestFeature getWindow().requestFeature()}. @param {Number} featureId The desired feature as defined in {@link android.view.Window}. @return {Boolean} Returns true if the requested feature is supported and now enabled. @see android.view.Window#requestFeature */ requestWindowFeature : function( ) {}, /**Convenience for calling {@link android.view.Window#setFeatureDrawableResource}. */ setFeatureDrawableResource : function( ) {}, /**Convenience for calling {@link android.view.Window#setFeatureDrawableUri}. */ setFeatureDrawableUri : function( ) {}, /**Convenience for calling {@link android.view.Window#setFeatureDrawable(int, Drawable)}. */ setFeatureDrawable : function( ) {}, /**Convenience for calling {@link android.view.Window#setFeatureDrawableAlpha}. */ setFeatureDrawableAlpha : function( ) {}, /** */ getLayoutInflater : function( ) {}, /**Sets whether this dialog is cancelable with the {@link KeyEvent#KEYCODE_BACK BACK} key. */ setCancelable : function( ) {}, /**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. @param {Boolean} cancel Whether the dialog should be canceled when touched outside the window. */ setCanceledOnTouchOutside : function( ) {}, /**Cancel the dialog. This is essentially the same as calling {@link #dismiss}(), but it will also call your {@link android.app.DialogInterface.OnCancelListener} (if registered). */ cancel : function( ) {}, /**Set a listener to be invoked when the dialog is canceled. <p>This will only be invoked when the dialog is canceled. Cancel events alone will not capture all ways that the dialog might be dismissed. If the creator needs to know when a dialog is dismissed in general, use {@link #setOnDismissListener}.</p> @param {Object {DialogInterface.OnCancelListener}} listener The {@link DialogInterface.OnCancelListener} to use. */ setOnCancelListener : function( ) {}, /**Set a message to be sent when the dialog is canceled. @param {Object {Message}} msg The msg to send when the dialog is canceled. @see #setOnCancelListener(android.content.DialogInterface.OnCancelListener) */ setCancelMessage : function( ) {}, /**Set a listener to be invoked when the dialog is dismissed. @param {Object {DialogInterface.OnDismissListener}} listener The {@link DialogInterface.OnDismissListener} to use. */ setOnDismissListener : function( ) {}, /**Sets a listener to be invoked when the dialog is shown. @param {Object {DialogInterface.OnShowListener}} listener The {@link DialogInterface.OnShowListener} to use. */ setOnShowListener : function( ) {}, /**Set a message to be sent when the dialog is dismissed. @param {Object {Message}} msg The msg to send when the dialog is dismissed. */ setDismissMessage : function( ) {}, /** @hide */ takeCancelAndDismissListeners : function( ) {}, /**By default, this will use the owner Activity's suggested stream type. @see Activity#setVolumeControlStream(int) @see #setOwnerActivity(Activity) */ setVolumeControlStream : function( ) {}, /** @see Activity#getVolumeControlStream() */ getVolumeControlStream : function( ) {}, /**Sets the callback that will be called if a key is dispatched to the dialog. */ setOnKeyListener : function( ) {}, };