Most visited

Recently visited

Added in API level 1

DialogInterface.OnKeyListener

public static interface DialogInterface.OnKeyListener

android.content.DialogInterface.OnKeyListener


将关键事件分派到此对话框时调用回调的接口定义。 在将键盘事件赋予对话框之前,将调用回调。

Summary

Public methods

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

当一个键被分派到一个对话框时调用。

Public methods

onKey

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

当一个键被分派到一个对话框时调用。 这使听众有机会在对话之前做出回应。

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.

Hooray!