I’m making a card game for android. You select your first card by clicking image1, second card by clicking image2, etc. These images run the same function in java, but how can I pass a variable to get that they clicked image1, image2, or image3? I’d like to avoid having 3 functions that are the exact same aside from one variable. Thanks for any input.
Share
I’m not sure what you mean by “images run the same function in java”, but if you mean they all have the same OnClickListener then use
getId()to determine which View was clicked.