Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;
import android.content.Intent;
import android.media.projection.MediaProjectionManager;

import static android.content.Context.MEDIA_PROJECTION_SERVICE;

public class Main {
    private static final int CREATE_SCREEN_CAPTURE = 4242;

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