0
I wish you could enlighten me on a situation. I want to change the image of an Imageview. I can even do it through the:
final ImageView imageView = (ImageView) findViewById(R.id.imageChm);
imageView.setImageResource(R.drawable.img1);
however, I have a few more images (img1, img2, img3, img4 ... img 50)
I would like them to use the same space, so I decided to adapt all to just imageView, in my case imageChm, each image would be indicated by a button. Ex: when clicking button1 the image that would appear would be img1, when clicking button2 the image will be img2 and so on.
How can I change the image address (R.drawable.img1) de forma dinamica ao clicar nos botões respectivos.
REMEMBERING THAT IN MY CASE THE BUTTON AND IMAGEVIEW ARE IN DIFFERENT ACTIVITIES
I ran two tests.. one with a button inside the Activity and it worked, another test was with the button in another Activity and in this case it didn’t work... you know why this happened?
– Renato Pedrozo
That’s another question... But, if you want to press the button in an Action to change in another, you will have to create a class and set a property.
– Marceloawq