java.lang.Object | |
↳ | android.media.projection.MediaProjection |
A token granting applications the ability to capture screen contents and/or record system audio. The exact capabilities granted depend on the type of MediaProjection.
A screen capture session can be started through createScreenCaptureIntent()
. This grants the ability to
capture screen contents, but not system audio.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MediaProjection.Callback | Callbacks for the projection session. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a
VirtualDisplay to capture the
contents of the screen.
| |||||||||||
Register a listener to receive notifications about when the
MediaProjection changes state.
| |||||||||||
Stops projection.
| |||||||||||
Unregister a MediaProjection listener.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a VirtualDisplay
to capture the
contents of the screen.
name | The name of the virtual display, must be non-empty. |
---|---|
width | The width of the virtual display in pixels. Must be greater than 0. |
height | The height of the virtual display in pixels. Must be greater than 0. |
dpi | The density of the virtual display in dpi. Must be greater than 0. |
flags | A combination of virtual display flags. See DisplayManager for the full
list of flags. |
surface | The surface to which the content of the virtual display should be rendered, or null if there is none initially. |
callback | Callback to call when the virtual display's state changes, or null if none. |
handler | The Handler on which the callback should be
invoked, or null if the callback should be invoked on the calling
thread's main Looper . |
Register a listener to receive notifications about when the MediaProjection
changes state.
callback | The callback to call. |
---|---|
handler | The handler on which the callback should be invoked, or null if the callback should be invoked on the calling thread's looper. |
Unregister a MediaProjection listener.
callback | The callback to unregister. |
---|