Example usage for android.content Intent ACTION_GET_CONTENT

List of usage examples for android.content Intent ACTION_GET_CONTENT

Introduction

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

Prototype

String ACTION_GET_CONTENT

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

Click Source Link

Document

Activity Action: Allow the user to select a particular kind of data and return it.

Usage

From source file:Main.java

private static Intent pickVideoIntent() {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("video/*"); // String VIDEO_UNSPECIFIED = "video/*";
    // Intent wrapperIntent = Intent.createChooser(innerIntent, null);
    return intent;
}

From source file:Main.java

public static Intent makeSystemAlbumIntent() {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    return intent;
}

From source file:Main.java

public static void choosePicture(Activity activity, int requestCode) {
    Intent openAlbumIntent = new Intent(Intent.ACTION_GET_CONTENT);
    openAlbumIntent.setType("image/*");
    activity.startActivityForResult(openAlbumIntent, requestCode);
}

From source file:Main.java

public static void pickImage(Activity activity, int requestCode) throws Exception {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
    intent.setType("image/*");
    // intent.putExtra("return-data", true);
    activity.startActivityForResult(intent, requestCode);
}

From source file:Main.java

public static void chooseFileIntent(Activity activity) {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    activity.startActivityForResult(intent, FILE_PICK);
}

From source file:Main.java

public static void choosePicture(Activity activity) {
    Intent openAlbumIntent = new Intent(Intent.ACTION_GET_CONTENT);
    openAlbumIntent.setType("image/*");
    activity.startActivityForResult(openAlbumIntent, CHOOSE_PICTURE);
}

From source file:Main.java

public static Intent getTakeGalleryIntent(Uri imageUri) {
    // Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    return intent;
}

From source file:Main.java

public static void pickPhoto(Activity activity, int resultCode) {
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    activity.startActivityForResult(intent, resultCode);
}

From source file:Main.java

public static void pickVideo(Activity activity, int resultCode) {
    Intent intent = new Intent();
    intent.setType("video/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    activity.startActivityForResult(intent, resultCode);
}

From source file:Main.java

public static void pickAudio(Activity activity, int resultCode) {
    Intent intent = new Intent();
    intent.setType("audio/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    activity.startActivityForResult(intent, resultCode);
}