0

I am trying to read images from Assets.In Assets i have been using a-z folders and these folders contains images with the starting name of folder like if there is folder named YImages then images in this folder image's names are also starting with Y word.

I am using this function to get images from Assets:

        try {
        pics = Drawable
                .createFromStream(
                        getAssets().open(
                                imageFolder + wordString.get(index)
                                + ".jpg"), null);

        picture.setBackgroundDrawable(pics);
        picture.refreshDrawableState();


    } catch (IOException e) {

        e.printStackTrace();
    }
User42590
  • 2,473
  • 12
  • 44
  • 85

2 Answers2

1

Theres a space at your image path. java.io.FileNotFoundException: yImages/ Year.jpg Try trimming the File name.

Rajitha Siriwardena
  • 2,749
  • 1
  • 18
  • 22
1

Just change all the image file name with the small letters do not use the capital letter in image file name . i.e badger_thumbnail.jpg,badge_thumbnail.jpg,year.jpg like this. Also keep in mind that there is no space in your any image name.

GrIsHu
  • 29,068
  • 10
  • 64
  • 102