Thursday, 19 September 2013

Open an image from asset folder in android

Open an image from asset folder in android

I need to get the images from asset folder by specifying the name of the
image and set it to Drawable.
drw =
Drawable.createFromStream(getAssets().open("/assets/images/"+drawables[i]),null);
But I get File not found exception.(images is subfolder of assets and
drawables[i]- name of the image(say "ball.jpg").

No comments:

Post a Comment