Skip to content

Most visited

Recently visited

navigation

MediaProjectionManager

public final class MediaProjectionManager
extends Object

java.lang.Object
   ↳ android.media.projection.MediaProjectionManager


Manages the retrieval of certain types of MediaProjection tokens.

Get an instance of this class by calling Context.getSystemService() with the argument MEDIA_PROJECTION_SERVICE.

Summary

Public methods

Intent createScreenCaptureIntent()

Returns an Intent that must passed to startActivityForResult() in order to start screen capture.

MediaProjection getMediaProjection(int resultCode, Intent resultData)

Retrieve the MediaProjection obtained from a succesful screen capture request.

Inherited methods

From class java.lang.Object

Public methods

createScreenCaptureIntent

added in API level 21
Intent createScreenCaptureIntent ()

Returns an Intent that must passed to startActivityForResult() in order to start screen capture. The activity will prompt the user whether to allow screen capture. The result of this activity should be passed to getMediaProjection.

Returns
Intent

getMediaProjection

added in API level 21
MediaProjection getMediaProjection (int resultCode, 
                Intent resultData)

Retrieve the MediaProjection obtained from a succesful screen capture request. Will be null if the result from the startActivityForResult() is anything other than RESULT_OK.

Parameters
resultCode int: The result code from onActivityResult(int, int, android.content.Intent)
resultData Intent: The resulting data from onActivityResult(int, int, android.content.Intent)
Returns
MediaProjection
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.