I have 16 blank square and i want to display a red Square randomly every 1 s so i used handler and this works. But when the user clicks on this red square the score is up by 1. i have tried to add onclicklistener to name but this is not what i need because once the squares background is red the score augments by 1 even when it returns to white so i have tried to add on click listener to each imageView starting with the first one but nothing happens; when i click on it the app crashes so what should i do?

