Pergunta

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 !!!

Foi útil?

Solução

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.

Outras dicas

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!

 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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top