I am trying to load an image from the asset
folder and then set it to an ImageView
. I know it's much better if I use the R.id.*
for this, but the premise is I don't know the id of the image. Basically, I'm trying to dynamically load the image via its filename.
For example, I randomly retrieve an element in the database
representing let's say a 'cow', now what my application would do is to display an image of a 'cow' via the ImageView
. This is also true for all element in the database
. (The assumption is, for every element there is an equivalent image)
thanks in advance.
EDIT
forgot the question, how do I load the image from the asset
folder?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…