I'm trying to make something happen when two ImageViews intersect each other. This is the code that I used:
Rect rect1 = new Rect();
imageView.getHitRect(rect1);
Rect rect4 = new Rect();
imageView2.getHitRect(rect4);
boolean collision = false;
collision = rect1.intersect(rect4);
if(collision = true){
button.setText("collided");
}else
button.setText("not collided");
However, the boolean just changed to true when the app starts. The first ImageView stays still while the other moves towards the first one (it's not a sprite, but it moves in the direction of the first ImageView and moves past it). I want the boolean to change when the two ImageViews intersect. Is there something I'm missing?