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.

4

1 回答 1

0

这是您从资产中获取图像所需要的

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

问候!

于 2013-06-05T19:06:13.027 回答