10

i m working with one application that have one functionality to select multiple images from android inbuilt Gallery/Camera .

Gallery is open successfully using below code.

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), SELECT_PICTURE);

but i am able to select only One image from Gallery. so please suggest me how to select multiple images from inbuilt gallery .

Thanks in Advance !!!

Hitarth
  • 1,950
  • 3
  • 27
  • 52
  • Have you noticed there are at least 2 duplicates of your question on stackoverflow? (http://stackoverflow.com/questions/3058922/select-multiple-images-using-galleryview) (http://stackoverflow.com/questions/4746661/select-multiple-images-from-photo-gallery-on-android-using-intents) – Adel Boutros Feb 21 '12 at 14:52

3 Answers3

6

i had refer this two link link 1

1: Select Multiple Images Using GalleryView and link 2

but not getting Ans for which i m looking for .. but i have found alternative solution . Get all images from inbuilt Gallery and set it all our custom Gellery .. kindly check out this link Custom Gallery with checkbox

i hope it will help you.

Community
  • 1
  • 1
Hitarth
  • 1,950
  • 3
  • 27
  • 52
1

Well, this is an old question, but I guess this might be still useful to somebody. I just released the source code for my multiple image selection activity. You can find it in the following GitHub repo:

https://github.com/derosa/MultiImageChooser

I hope it's useful for you!

1
 Cursor imagecursor1 = managedQuery(
    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns, null,
    null, orderBy + " DESC");

   this.imageUrls = new ArrayList<String>();
  imageUrls.size();

   for (int i = 0; i < imagecursor1.getCount(); i++) {
   imagecursor1.moveToPosition(i);
   int dataColumnIndex = imagecursor1
     .getColumnIndex(MediaStore.Images.Media.DATA);
   imageUrls.add(imagecursor1.getString(dataColumnIndex));
  }

   options = new DisplayImageOptions.Builder()
  .showStubImage(R.drawable.stub_image)
  .showImageForEmptyUri(R.drawable.image_for_empty_url)
  .cacheInMemory().cacheOnDisc().build();

   imageAdapter = new ImageAdapter(this, imageUrls);

   gridView = (GridView) findViewById(R.id.PhoneImageGrid);
  gridView.setAdapter(imageAdapter);

You want to more clarifications. http://mylearnandroid.blogspot.in/2014/02/multiple-choose-custom-gallery.html