• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Compare an ImageView's Background to a Drawable

anthonyz

Lurker
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?
 

Attachments

  • 2.PNG
    2.PNG
    21.2 KB · Views: 127
  • 1.PNG
    1.PNG
    51.1 KB · Views: 119
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?
2.PNG 1.PNG
 
Back
Top Bottom