0

I am new to android, please help me to resolve this. I need to retrieve all images from gallery and show that like an animation using timer or thread. I Used below code get images from gallery how can I store the images in an array?My idea is to make animation using timer by picking images from an array and put in a single Imageview. but I could not store the images retrieved from gallery to an array. I could display it in gridview by using Imageadapter. In short I need to get n number of images from gallery and place it in an array and make animation using timer and single imageview.

String[] projection = {MediaStore.Images.Thumbnails._ID};
cursor=getContentResolver().query(MediaStore.Images.Thumbnails.INTERNAL_CONTENT_URI,
            projection,null,null,MediaStore.Images.Thumbnails.IMAGE_ID);

2 Answers2

1

You need to use AnimationDrawable and it's addFrame method. Here is the document.

asozcan
  • 1,370
  • 1
  • 17
  • 24
  • I want to retrieve all the images available in the gallery –  Sep 17 '15 at 11:21
  • ok, i edit my answer ;) Firstly get your all images and convert them to drawable and use AnimationDrawable with calling addFrame method. – asozcan Sep 17 '15 at 11:23
0

You can try below link.

It will show how you can select multiple images from gallery;

Get/pick an image from Android's built-in Gallery app programmatically

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

Community
  • 1
  • 1
KishuDroid
  • 5,411
  • 4
  • 30
  • 47