start Photo Zoom via Intent - Android Intent

Android examples for Intent:Picture Pickup

Description

start Photo Zoom via Intent

Demo Code


//package com.java2s;
import java.io.File;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {
    public static File picTemp;

    public static void startPhotoZoom(Context context, Uri uri, int size) {
        Intent intent = new Intent("com.android.camera.action.CROP");
        intent.setDataAndType(uri, "image/*");
        intent.putExtra("crop", "true");
        intent.putExtra("output", Uri.fromFile(picTemp));
        ((Activity) context).startActivityForResult(intent, 2);
    }// w  ww . ja v  a2 s .c om
}

Related Tutorials