Paul
Paul

Reputation: 1

Text inserted in the edittext is overwritten

I'm a beginner and am making a calculator (fairly easy), but it's happening the following problem: When Cline in "1" button for example, he enters this number in the EditText, but if you click again the number is overwritten instead of the inserted his side as desired. How do the numbers were placed side by side without overwriting those already there?

Note: The layout of buttons and etc. I did in. XML, so I'm not using the keyboard native Android.

Thanks!

Upvotes: 0

Views: 832

Answers (1)

davogotland
davogotland

Reputation: 2777

when you want to add a new number next to the old one, you probably need to

  1. get the value that is currently being shown in this "edit text" and save it in a string
  2. concatenate this old value with the new one that you want to add to your "edit text"
  3. set this new concatenated value as the new text in your "edit text"

:)

Upvotes: 1

Related Questions