Example usage for android.content Intent ACTION_PICK

List of usage examples for android.content Intent ACTION_PICK

Introduction

In this page you can find the example usage for android.content Intent ACTION_PICK.

Prototype

String ACTION_PICK

To view the source code for android.content Intent ACTION_PICK.

Click Source Link

Document

Activity Action: Pick an item from the data, returning what was selected.

Usage

From source file:Main.java

public static Intent openGallery() {
    return new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
}

From source file:Main.java

public static Intent selectPhoto() {
    Intent intent = new Intent(Intent.ACTION_PICK, null);
    intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");

    return intent;
}

From source file:Main.java

public static Intent getImageFromGallery() {
    Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    intent.setType("image/*");
    return intent;
}

From source file:Main.java

public static void turnPhotosWithCrop(Activity mContext, int requestCode) {
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setType("image/*");
    intent.putExtra("return-data", true);
    mContext.startActivityForResult(intent, requestCode);
}

From source file:Main.java

public static void chooseMediaFromExternal(Activity activity, int requestCode) {
    Intent choosePictureIntent = new Intent(Intent.ACTION_PICK,
            android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    activity.startActivityForResult(choosePictureIntent, requestCode);
}

From source file:Main.java

public static void chooseVideoFromExternal(Activity activity, int requestCode) {
    Intent choosePictureIntent = new Intent(Intent.ACTION_PICK,
            android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
    activity.startActivityForResult(choosePictureIntent, requestCode);
}

From source file:Main.java

public static void choosePictureFromExternal(Activity activity, int requestCode) {
    Intent choosePictureIntent = new Intent(Intent.ACTION_PICK,
            android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    activity.startActivityForResult(choosePictureIntent, requestCode);
}

From source file:Main.java

public static void toTakePicture(int requestcode, Activity activity) {
    Intent intent = new Intent(Intent.ACTION_PICK, null);
    intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
    activity.startActivityForResult(intent, requestcode);
}

From source file:Main.java

public static void startSystemGallery(Activity activity, int resultCode) {
    Intent intent1 = new Intent(Intent.ACTION_PICK, null);
    intent1.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
    activity.startActivityForResult(intent1, resultCode);
}

From source file:Main.java

public static void pickImageFromPhoto(Activity activity, int requestCode) {

    Intent intent = new Intent(Intent.ACTION_PICK, null);
    intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
    activity.startActivityForResult(intent, requestCode);

}