Search code examples
androidandroid-activityandroid-gallery

how to get all the images from in built gallery to my application...?


I want to start in built gallery activity for multiple selection.

I have tried this, but it selects only one image.

Thanks in advance..!


Solution

  • You have to create your own list of images having checkboxes to select multiple image files.

    Use the below code to get the cursor for gallery and create a list adapter which will iterate over cursor and will give image. This image can be used to show in list view with checkboxes.

    String[] projection = { MediaStore.Images.Media.DATA };
    Cursor cursor = managedQuery(uri, projection, null, null, null);