public static interface Window.Callback
Modifier and Type | Method and Description |
---|---|
boolean |
dispatchGenericMotionEvent(MotionEvent event)
Called to process generic motion events.
|
boolean |
dispatchKeyEvent(KeyEvent event)
Called to process key events.
|
boolean |
dispatchKeyShortcutEvent(KeyEvent event)
Called to process a key shortcut event.
|
boolean |
dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
Called to process population of
AccessibilityEvent s. |
boolean |
dispatchTouchEvent(MotionEvent event)
Called to process touch screen events.
|
boolean |
dispatchTrackballEvent(MotionEvent event)
Called to process trackball events.
|
void |
onActionModeFinished(ActionMode mode)
Called when an action mode has been finished.
|
void |
onActionModeStarted(ActionMode mode)
Called when an action mode has been started.
|
void |
onAttachedToWindow()
Called when the window has been attached to the window manager.
|
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 |
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'.
|
void |
onDetachedFromWindow()
Called when the window has been attached to the window manager.
|
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.
|
void |
onPanelClosed(int featureId,
Menu menu)
Called when a panel is being closed.
|
boolean |
onPreparePanel(int featureId,
View view,
Menu menu)
Prepare a panel to be displayed.
|
default void |
onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data,
Menu menu,
int deviceId)
Called when Keyboard Shortcuts are requested for the current window.
|
boolean |
onSearchRequested()
Called when the user signals the desire to start a search.
|
boolean |
onSearchRequested(SearchEvent searchEvent)
Called when the user signals the desire to start a search.
|
void |
onWindowAttributesChanged(WindowManager.LayoutParams attrs)
This is called whenever the current window attributes change.
|
void |
onWindowFocusChanged(boolean hasFocus)
This hook is called whenever the window focus changes.
|
ActionMode |
onWindowStartingActionMode(ActionMode.Callback callback)
Called when an action mode is being started for this window.
|
ActionMode |
onWindowStartingActionMode(ActionMode.Callback callback,
int type)
Called when an action mode is being started for this window.
|
boolean dispatchKeyEvent(KeyEvent event)
Window.superDispatchKeyEvent(android.view.KeyEvent)
to do the
standard key processing.event
- The key event.boolean dispatchKeyShortcutEvent(KeyEvent event)
Window.superDispatchKeyShortcutEvent(android.view.KeyEvent)
to do the
standard key shortcut processing.event
- The key shortcut event.boolean dispatchTouchEvent(MotionEvent event)
Window.superDispatchTouchEvent(android.view.MotionEvent)
to do the
standard touch screen processing.event
- The touch screen event.boolean dispatchTrackballEvent(MotionEvent event)
Window.superDispatchTrackballEvent(android.view.MotionEvent)
to do the
standard trackball processing.event
- The trackball event.boolean dispatchGenericMotionEvent(MotionEvent event)
Window.superDispatchGenericMotionEvent(android.view.MotionEvent)
to do the
standard processing.event
- The generic motion event.boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
AccessibilityEvent
s.event
- The event.View onCreatePanelView(int featureId)
featureId
- Which panel is being created.onPreparePanel(int, android.view.View, android.view.Menu)
boolean onCreatePanelMenu(int featureId, Menu menu)
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.
featureId
- The panel being created.menu
- The menu inside the panel.boolean onPreparePanel(int featureId, View view, Menu menu)
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.onCreatePanelView(int)
boolean onMenuOpened(int featureId, Menu menu)
featureId
- The panel that the menu is in.menu
- The menu that is opened.boolean onMenuItemSelected(int featureId, MenuItem item)
featureId
- The panel that the menu is in.item
- The menu item that was selected.void onWindowAttributesChanged(WindowManager.LayoutParams attrs)
void onContentChanged()
Window.setContentView
or
Window.addContentView
).void onWindowFocusChanged(boolean hasFocus)
View.onWindowFocusChangedNotLocked(boolean)
for more information.hasFocus
- Whether the window now has focus.void onAttachedToWindow()
View.onAttachedToWindow()
for more information.void onDetachedFromWindow()
View.onDetachedFromWindow()
for more information.void onPanelClosed(int featureId, Menu menu)
featureId
- The panel that is being displayed.menu
- If onCreatePanelView() returned null, this is the Menu
being displayed in the panel.boolean onSearchRequested()
Activity.onSearchRequested()
boolean onSearchRequested(SearchEvent searchEvent)
searchEvent
- A SearchEvent
describing the signal to
start a search.ActionMode onWindowStartingActionMode(ActionMode.Callback callback)
onWindowStartingActionMode(android.view.ActionMode.Callback, int)
with type ActionMode.TYPE_PRIMARY
.callback
- Callback to control the lifecycle of this action modeActionMode onWindowStartingActionMode(ActionMode.Callback callback, int type)
callback
- Callback to control the lifecycle of this action modetype
- One of ActionMode.TYPE_PRIMARY
or ActionMode.TYPE_FLOATING
.void onActionModeStarted(ActionMode mode)
mode
- The new mode that has just been started.void onActionModeFinished(ActionMode mode)
mode
- The mode that was just finished.default void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, Menu menu, int deviceId)
data
- The data list to populate with shortcuts.menu
- The current menu, which may be null.deviceId
- The id for the connected device the shortcuts should be provided for.