Example usage for android.media.projection MediaProjectionManager createScreenCaptureIntent

List of usage examples for android.media.projection MediaProjectionManager createScreenCaptureIntent

Introduction

In this page you can find the example usage for android.media.projection MediaProjectionManager createScreenCaptureIntent.

Prototype

public Intent createScreenCaptureIntent() 

Source Link

Document

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

Usage

From source file:Main.java

static void fireScreenCaptureIntent(Activity activity) {
    MediaProjectionManager manager = (MediaProjectionManager) activity
            .getSystemService(MEDIA_PROJECTION_SERVICE);
    Intent intent = manager.createScreenCaptureIntent();
    activity.startActivityForResult(intent, CREATE_SCREEN_CAPTURE);
}

From source file:Main.java

static void fireScreenCaptureIntent(Activity activity) {
    MediaProjectionManager manager = (MediaProjectionManager) activity
            .getSystemService(Context.MEDIA_PROJECTION_SERVICE);
    Intent intent = manager.createScreenCaptureIntent();
    activity.startActivityForResult(intent, CREATE_SCREENSHOT);
    Log.i("TakeScreenshotService", "fireScreenCaptureIntent...");
}

From source file:com.garlicg.screenrecord4cm.SettingsActivity.java

/**
 * ?//from   w  w w. j  a  va 2s  .  c o  m
 */
void requestCapture(int requestCode) {
    MediaProjectionManager mm = (MediaProjectionManager) getSystemService(MEDIA_PROJECTION_SERVICE);
    Intent intent = mm.createScreenCaptureIntent();
    startActivityForResult(intent, requestCode);
}