Android APIs
public final class

MediaProjectionManager

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

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Intent createScreenCaptureIntent ()

Added in API level 21

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.

public MediaProjection getMediaProjection (int resultCode, Intent resultData)

Added in API level 21

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 The result code from onActivityResult(int, int, android.content.Intent)
resultData The resulting data from onActivityResult(int, int, android.content.Intent)