1

I am trying to build an on screen keyboard, for a simple counter application, that adds some points for 2 diffeent teams in 2 columns.

enter image description here

The design thing is pretty simple, but it seems hard for me to programm the buttons, in order to insert numbers properly.

I have added all the necesery OnClickListeners and used for example this code for number 1

editText1.setText("1");

But, when i try to press the 1 button multiple times, it doesn't type 111 etc. It keeps replacing the last number that was inputed. So if i press 1 and then 2, it just replaces 1 with 2.

Any idea on how this can work please? :D

1 Answer 1

2

setText sets the text. It doesn't append the text. If you want to append, use editText1.setText(editText1.getText()+"1");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.