Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Intent; import android.provider.MediaStore; public class Main { public static void captureImage(Activity activity, int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); activity.startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE); } }