I want to set image dynamically on the ImageButton in android. However, I have more than 200 images. What would be the good solution for that?
The best idea is that I can use the name of image to call different images. i.e. imagebutton.setImage("/res/abc.png"); however, it seems to me that it is not trivial to do so.. please help me to solve these problems.
You could use Typed Array resource. There is an example at the end of the link how to use it for drawables (images).
Edited:
Resources can be accessed as raw data: use AssetManager.open(..)
Then you can use BitmapFactory.decodeStream(..) to create a Bitmap from the data stream.