android.view
public
static
interface
android.view.Window.Callback
android.view.Window.Callback |
|
API from a Window back to its caller. This allows the client to
intercept key dispatching, panels and menus, etc.
Known Indirect Subclasses
Activity,
ActivityGroup,
AlertDialog,
AliasActivity,
CharacterPickerDialog,
DatePickerDialog,
Dialog,
ExpandableListActivity,
LauncherActivity,
ListActivity,
MapActivity,
PreferenceActivity,
ProgressDialog,
TabActivity,
TimePickerDialog
Activity |
An activity is a single, focused thing that the user can do. |
ActivityGroup |
A screen that contains and runs multiple embedded activities. |
AlertDialog |
A subclass of Dialog that can display one, two or three buttons. |
AliasActivity |
Stub activity that launches another activity (and then finishes itself)
based on information in its component's manifest meta-data. |
CharacterPickerDialog |
Dialog for choosing accented characters related to a base character. |
DatePickerDialog |
A simple dialog containing an DatePicker. |
Dialog |
Base class for Dialogs. |
ExpandableListActivity |
An activity that displays an expandable list of items by binding to a data
source implementing the ExpandableListAdapter, and exposes event handlers
when the user selects an item. |
LauncherActivity |
Displays a list of all activities which can be performed
for a given intent. |
ListActivity |
An activity that displays a list of items by binding to a data source such as
an array or Cursor, and exposes event handlers when the user selects an item. |
MapActivity |
Base class with code to manage the boring necessities of any
activity that displays a MapView. |
PreferenceActivity |
The PreferenceActivity activity shows a hierarchy of preferences as
lists, possibly spanning multiple screens. |
ProgressDialog |
A dialog showing a progress indicator and an optional text message or view. |
TabActivity |
An activity that contains and runs multiple embedded activities or views. |
TimePickerDialog |
A dialog that prompts the user for the time of day using a TimePicker. |
Summary
Details
Public Methods
public
boolean
dispatchKeyEvent(KeyEvent event)
Called to process key events. At the very least your
implementation must call
superDispatchKeyEvent(KeyEvent) to do the
standard key processing.
Returns
- boolean Return true if this event was consumed.
public
boolean
dispatchTouchEvent(MotionEvent event)
Called to process touch screen events. At the very least your
implementation must call
superDispatchTouchEvent(MotionEvent) to do the
standard touch screen processing.
Parameters
event
| The touch screen event. |
Returns
- boolean Return true if this event was consumed.
public
boolean
dispatchTrackballEvent(MotionEvent event)
Called to process trackball events. At the very least your
implementation must call
superDispatchTrackballEvent(MotionEvent) to do the
standard trackball processing.
Parameters
event
| The trackball event. |
Returns
- boolean Return true if this event was consumed.
public
void
onContentChanged()
This hook is called whenever the content view of the screen changes
(due to a call to setContentView().
public
boolean
onCreatePanelMenu(int featureId, Menu menu)
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.
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.
public
View
onCreatePanelView(int featureId)
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.
Parameters
featureId
| Which panel is being created. |
Returns
- view The top-level view to place in the panel.
public
boolean
onMenuItemSelected(int featureId, MenuItem item)
Called when a panel's menu item has been selected by the user.
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).
public
boolean
onMenuOpened(int featureId, Menu menu)
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).
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.
public
void
onPanelClosed(int featureId, Menu menu)
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.
Parameters
featureId
| The panel that is being displayed. |
menu
| If onCreatePanelView() returned null, this is the Menu
being displayed in the panel.
|
public
boolean
onPreparePanel(int featureId, View view, Menu menu)
Prepare a panel to be displayed. This is called right before the
panel window is shown, every time it is shown.
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.
public
boolean
onSearchRequested()
Called when the user signals the desire to start a search.
Returns
- true if search launched, false if activity refuses (blocks)
This is called whenever the current window attributes change.
public
void
onWindowFocusChanged(boolean hasFocus)
This hook is called whenever the window focus changes.
Parameters
hasFocus
| Whether the window now has focus.
|