I have an application in which there is an ImageView .

I can take one picture from the gallery using:

 Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, GALLERY_REQUEST); 

and transfer it to my application in ImageView .

Is it possible to make it so that I can select several pictures simultaneously from the gallery and transfer them to my ImageView application?

If so, how to do it?

If not, please suggest alternatives, if any.

Thank.

    1 answer 1

    Yes you can. There are several options:

    1. Add EXTRA_ALLOW_MULTIPLE flag:

       photoPickerIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); 

      BUT , this option will work far from everywhere and, possibly, not as it should.

    2. Use a third-party solution like this or these .

    3. Write your own picture selection dialog.

    Most preferably , in my opinion, option number 2 .

    • And how to check the first option? I entered Extra_Allow_multiply, launched the application and how can I select some pictures here? I click on one and it is immediately saved in imageView? - Andrew Lawmaking 1:58
    • @AndrewLawmaking, As I said before, this is not a very good solution that does not always work. Better use the library from the second option. - post_zeew
    • Well thank you. And with the video can also be done? For example, select all the videos from the gallery and transfer them to my application? - Andrew Lawmaking
    • @AndrewLawmaking, Yes, you can, using the appropriate libraries, for example. - post_zeew
    • if not difficult to share links please - Andrew Lawmaking