Skip to content

Most visited

Recently visited

navigation
Added in API level 1

DialogInterface.OnKeyListener

public static interface DialogInterface.OnKeyListener

android.content.DialogInterface.OnKeyListener


Interface definition for a callback to be invoked when a key event is dispatched to this dialog. The callback will be invoked before the key event is given to the dialog.

Summary

Public methods

abstract boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event)

Called when a key is dispatched to a dialog.

Public methods

onKey

Added in API level 1
boolean onKey (DialogInterface dialog, 
                int keyCode, 
                KeyEvent event)

Called when a key is dispatched to a dialog. This allows listeners to get a chance to respond before the dialog.

Parameters
dialog DialogInterface: The dialog the key has been dispatched to.
keyCode int: The code for the physical key that was pressed
event KeyEvent: The KeyEvent object containing full information about the event.
Returns
boolean True if the listener has consumed the event, false otherwise.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.