Create Intent to capture Video - Android Media

Android examples for Media:Video

Description

Create Intent to capture Video

Demo Code


//package com.java2s;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import android.provider.MediaStore;

public class Main {
    public static int REQUEST_CAPTURE_VIDEO = 3;

    public static void captureVideo(Context context) {
        Intent intent2 = new Intent();
        intent2.setAction(MediaStore.ACTION_VIDEO_CAPTURE);
        intent2.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); // ???????
        ((Activity) context).startActivityForResult(intent2,
                REQUEST_CAPTURE_VIDEO);/*from ww  w.  j a va  2  s. c o  m*/
    }
}

Related Tutorials