1

I have a folder witch contains sub folders. There are Images in Sub Folders and the Number of Images varies from folder to folder. How i can get the List of all images from Drawable by java. following is the code for the assets folder. I want like this for Drawable

   String[] files = assetManager.list("Deaf/0"+possition);
M.ArslanKhan
  • 3,640
  • 8
  • 34
  • 56

1 Answers1

2

First you need to Create int[] Array that store all your images id like:

int[] type_img=new int[]{R.drawable.img1,R.drawable.img2,R.drawable.img3,R.drawable.img4,R.drawable.img5};

And load your images into loop like:

for(int i=0;i<type_img.length();i++){
        image_view.setBackground(activity.getResources().getDrawable(type_img[i])));
    }
M D
  • 47,665
  • 9
  • 93
  • 114
  • I want to get names of all images in a list,my Main folder has sub folders and each sub folder has different numbers of images. – M.ArslanKhan Feb 06 '14 at 07:27