Create Intent to choose Picture - Android Intent

Android examples for Intent:Picture Pickup

Description

Create Intent to choose Picture

Demo Code


//package com.java2s;

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

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)/*from w w  w .  j  ava2 s  .c o  m*/
                .startActivityForResult(intent3, REQUEST_CHOOSE);
    }
}

Related Tutorials