In my application, I have button and ImageView
.
Here when i press button i want to change ImageView
. I have 5 images in my drawable folder. On press button ImageView changes images one by one based on button click. I want it's solution.
Grateful to anyone that can help.
As @Nizam said just maintain an array of id and load dinamically the image in the onClick(). Instead of the Random use a field variable and increment it. Be careful to the array length!
Maintain an array of image ids and inside onClick, set images using id from the array, then increment index.
Eg:-