0

In my application I am trying to select multiple images from gallery and I want to move to my folder.

I tried with some example coding its not working properly.

I used android code its getting selecting the multiple images but how to get all the images in onActivity result.

I have tried so far

  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 Picture"), 1);

How to select these images in OnActivity Result

Then also I tried with this link But its not showing all the images from gallery and after moving its not updating the gallery

James Z
  • 12,209
  • 10
  • 24
  • 44
John
  • 1,407
  • 7
  • 26
  • 51

2 Answers2

0

I hope below link is help you

click here

Jai Rajesh
  • 939
  • 5
  • 18
0

To retrieve all images from gallery, try using a MergeCursor, http://developer.android.com/reference/android/database/MergeCursor.html

Use two cursors, one to retrieve image metadata from EXTERNAL_CONTENT_URI and another from INTERNAL_CONTENT_URI as follows:

Cursor cursor1 = this.context.getContentResolver().query(
            MediaStore.Images.Media.INTERNAL_CONTENT_URI, null, null, null, null);
Cursor cursor2 = this.context.getContentResolver().query(
            MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);
MergeCursor cursor = new MergeCursor(new Cursor[]{ cursor1, cursor2 });

Refer this code here - https://github.com/ayanami/android-sample/blob/master/image-select-sample/src/com/example/hoge/ImageMediaManager.java

Darshan Dorai
  • 659
  • 8
  • 10