Search code examples
androidandroid-imagepicker

How to pick multiple images from gallery?


In my application I allow to user to select multiple images to create pdf.

Issue is user is not able to select more than 1 images. I tried a lot but didn't get any perfect solution which can help me.

There are lot many lib available but i don't want to use it due to some reason.

I am looking for solution with native only.

Please help me.


Solution

  • Simple by putting extra:

    int RESULT_IMAGE_MULTIPLE = 1; 
    
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent,"Select pictures"), RESULT_IMAGE_MULTIPLE);