Kartik Bhatt
Kartik Bhatt

Reputation: 924

Select Multiple Images in Android

I want to Select Multiple Images in Android.

I write following code through which I can select only one image.

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, IMAGE_PICK);

How I can achieve this ?

Thanks.

Upvotes: 1

Views: 778

Answers (2)

qinmiao
qinmiao

Reputation: 5789

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)//Api Level 18
public void selectPhotos(){
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
    startActivityForResult(Intent.createChooser(intent,
            "select Multiple Images"), SELECT_PHOTOS_RESULT);
}

Upvotes: 0

Delimitry
Delimitry

Reputation: 3027

As I know standard Intent doesn't support multiple selection. You could try to extend ListView and make your own custom view to allow multiple selection.

Upvotes: 1

Related Questions