int cannot be converted to string?

You can convert to String using Integer.toString() :

square.setText(Integer.toString(x));

Leave a Comment