0

How do I randomly highlight a button in Android studio. For example, there are 4 buttons/views and I want one of them randomly highlighted, then if users correctly select the highlighted one, the other buttons will be randomly highlighted and previous highlighted buttons will be remain visible but not highlighted

I have tried browsing online to find related methods, but unsuccessful

  • 1
    Do you know how to highlight a *specific* button in Android? Do you know how to pick a random element from an array/collection? If so, combine those two and you're done. If not, show/tell us which of those you can do and where the issue is. – Joachim Sauer Mar 16 '23 at 10:40
  • I dont know how to highlight a specific button – Lew Ernest Mar 16 '23 at 10:48
  • 1
    So you need this one: [How to make Button highlight?](https://stackoverflow.com/questions/4131656/how-to-make-button-highlight) – Joachim Sauer Mar 16 '23 at 10:51
  • but that one didnt mention how to make button highlight without touching them – Lew Ernest Mar 16 '23 at 11:58
  • 1
    Yes, and that's where you combine what you learned with other things. So now you know how to highlight a button. Next figure out how to pick a random button to highlight... and so on and so on. ... – Joachim Sauer Mar 16 '23 at 12:00

0 Answers0