I've just started learning Android development and as a little project, I'm building a calculator. The way it works is that when a number button is pressed, the number is appended to the EditText. I don't want to write this code for each of the buttons, because it's tedious and blatantly inefficient but i'm not sure how to go about it.
When I programmed in Java, I got around the problem by setting the ActionCommand of the JButton equal to the number and then making a general
textField.append(button.getActionCommand());
Is this possible in Android? Is there a better approach? Thanks for your help!