2
I wanted to create a app
that clicking on an image changed your image and was waiting to click on another image. If the two images were equal (with the same value) activates a button that gave the possibility to pass to another Layout.
I only have the code to change the image.
botao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if( ????????? )
botao.setBackgroundResource(R.drawable.preto);
else
botao.setBackgroundResource(R.drawable.verde);
}
It is not clear what you want. However, if you want to know is if two images (drawables) are equal see this reply
– ramaral
I want to associate two images (like those games that we have to click to discover the images and are only shown when they are iguas)
– sergiopm
You want to make a memory game, right?
– Thiago Luiz Domacoski
Yes, that was my idea
– sergiopm
this.. is a memory game... In fact the image is just "the shell" of the problem. this has to be done with programming logic. You can use an arraylist with twenty members, 10 of them being repeated, and shuffle them. then just fill a "gridview" with the arraylist and when you click just check if they are equal.
– Mr_Anderson
Where can I read more how to make an arraylist? ..
– sergiopm