0

Just like the title says, i can't seem to get the images in my assets folder to open up.

public static final String CONTENT_URI = "file:///android:asset/";
Uri tmp = Uri.parse(CONTENT_URI + s);
holder.image.setImageURI(tmp);

I have tried a bunch of different syntax's, and I can't seem to get the asset to be detected. Keep getting resolveUri errors about it not finding the files.

s is a string such as hears.png which is indeed in the assets folder.

MasterGberry
  • 2,800
  • 6
  • 37
  • 56

1 Answers1

0

This is what you need to get images from asset

yourImageView.setImageBitmap(BitmapFactory.decodeStream(activity.getResources().getAssets().open("whateverResorce.png")));

Regards!

Martin Cazares
  • 13,637
  • 10
  • 47
  • 54