How catch the button clicked by the user

Hi everyone, I'm new in Android World.
I'm trying to implement the audio-game of Memory; each tile is represented by a button to which a sound is associated.
Now, I have to verify the sounds of a pair of tiles (the buttons that the user clicked) are the same, but I can't catch what the buttons that the user pressed are.
thanks to those who can help me