Answer the question
In order to leave comments, you need to log in
How to display an image together with a variable from an array?
I have an array. On button click, it pops up a random animal in the textView . I want each element of the array to have its own image, for example: a wolf is displayed in a textView, and an image of a wolf is displayed in an ImageView. How to implement it?
Answer the question
In order to leave comments, you need to log in
android imageview set image resource programmatically
remember the
android formula .... programmatically
in the middle of what and where you want to put
setImageResource() - this is if the pictures are in a drawable or mipmap
In general, study the methods of the standard ImageView . But most likely you will want to take some other component, with zoom and stuff out of the box.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question