Yes, you do that, but after you ask if three buttons are the same! So it will enter in that as true and then when you ask if it's an X or an O it will do nothing, that's why your app never shows who wins.
When one IF returns true, the other ELSE IF are skipped.
EXAMPLE: You are checking if button1 = button2 AND if button1 = button3.
That will return true when any of this combinations is found
"X" "X" "X"
"O", "O", "O"
"<empty> ", "<empty> ", "<empty>"
So, like I said before, check that the initial button.text is not an empty string.