android – How to load images from mipmap folder programmatically?-ThrowExceptions

Exception or error:

How to load images from the mipmap folder programmatically (as done with the drawables)?

  img.setImageResource(imageId);

I am using Android Studio 1.2.1.

How to solve:

In Android Studio We have mipmap instead of drawable
You Can Find Documents Related To Your Assets Here

You can use it Like

 img.setImageResource(R.mipmap.ic_launcher);

###

You can do

img.setImageResource(R.mipmap.imageid);

Leave a Reply

Your email address will not be published. Required fields are marked *