How to check whether the jigsaw puzzle is completed or not?

后端 未结 4 1681
面向向阳花
面向向阳花 2021-01-26 00:40

i am preparing one small game like jigsaw , for that i am using 9 imageview\'s with 9 different images in the layout. set the images to imageview at the time of starting those a

4条回答
  •  不要未来只要你来
    2021-01-26 01:11

    When you use == operator they are checking if both the objects are referencing the same object. But in your case they are 2 different objects.

    You should set a tag to both the actual image and the other image. And check if they are both the same. That should work in your if condition.

    For the drawable class i did notice a method setLevel and getLevel. You might be able to use this for your requirement.

提交回复
热议问题