public interface WindowManager extends ViewManager
Use Context.getSystemService(Context.WINDOW_SERVICE)
to get one of these.
Each window manager instance is bound to a particular Display
.
To obtain a WindowManager
for a different display, use
Context.createDisplayContext(android.view.Display)
to obtain a Context
for that
display, then use Context.getSystemService(Context.WINDOW_SERVICE)
to get the WindowManager.
The simplest way to show a window on another display is to create a
Presentation
. The presentation will automatically obtain a
WindowManager
and Context
for that display.
Modifier and Type | Interface and Description |
---|---|
static class |
WindowManager.BadTokenException
Exception that is thrown when trying to add view whose
WindowManager.LayoutParams WindowManager.LayoutParams.token
is invalid. |
static class |
WindowManager.InvalidDisplayException
Exception that is thrown when calling
ViewManager.addView(android.view.View, android.view.ViewGroup.LayoutParams) to a secondary display that cannot
be found. |
static interface |
WindowManager.KeyboardShortcutsReceiver
Used to asynchronously request Keyboard Shortcuts from the focused window.
|
static class |
WindowManager.LayoutParams |
Modifier and Type | Field and Description |
---|---|
static int |
DOCKED_BOTTOM |
static int |
DOCKED_INVALID |
static int |
DOCKED_LEFT |
static int |
DOCKED_RIGHT |
static int |
DOCKED_TOP |
static String |
PARCEL_KEY_SHORTCUTS_ARRAY |
static int |
TAKE_SCREENSHOT_FULLSCREEN
Message for taking fullscreen screenshot
|
static int |
TAKE_SCREENSHOT_SELECTED_REGION
Message for taking screenshot of selected region.
|
Modifier and Type | Method and Description |
---|---|
Display |
getDefaultDisplay()
Returns the
Display upon which this WindowManager instance
will create new windows. |
void |
removeViewImmediate(View view)
Special variation of
ViewManager.removeView(android.view.View) that immediately invokes
the given view hierarchy's View.onDetachedFromWindow() methods before returning. |
void |
requestAppKeyboardShortcuts(WindowManager.KeyboardShortcutsReceiver receiver,
int deviceId)
Request for keyboard shortcuts to be retrieved asynchronously.
|
addView, removeView, updateViewLayout
static final int DOCKED_INVALID
static final int DOCKED_LEFT
static final int DOCKED_TOP
static final int DOCKED_RIGHT
static final int DOCKED_BOTTOM
static final int TAKE_SCREENSHOT_FULLSCREEN
static final int TAKE_SCREENSHOT_SELECTED_REGION
static final String PARCEL_KEY_SHORTCUTS_ARRAY
Display getDefaultDisplay()
Display
upon which this WindowManager
instance
will create new windows.
Despite the name of this method, the display that is returned is not
necessarily the primary display of the system (see Display.DEFAULT_DISPLAY
).
The returned display could instead be a secondary display that this
window manager instance is managing. Think of it as the display that
this WindowManager
instance uses by default.
To create windows on a different display, you need to obtain a
WindowManager
for that Display
. (See the WindowManager
class documentation for more information.)
void removeViewImmediate(View view)
ViewManager.removeView(android.view.View)
that immediately invokes
the given view hierarchy's View.onDetachedFromWindow()
methods before returning. This is not
for normal applications; using it correctly requires great care.view
- The view to be removed.void requestAppKeyboardShortcuts(WindowManager.KeyboardShortcutsReceiver receiver, int deviceId)
receiver
- The callback to be triggered when the result is ready.