choose Picture via Intent - Android android.graphics

Android examples for android.graphics:Picture

Description

choose Picture via Intent

Demo Code

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.provider.MediaStore;
import android.provider.MediaStore;
import java.io.File;

public class Main{

    public static int REQUEST_CHOOSE = 2;
    public static void choosePicture(Context context) {
        Intent intent3 = new Intent();
        intent3.setType("image/*");
        intent3.setAction(Intent.ACTION_GET_CONTENT);
        ((Activity) context)// www .j a  va  2s . c  o  m
                .startActivityForResult(intent3, REQUEST_CHOOSE);
    }

}

Related Tutorials