Text inserted in the edittext is overwritten
I'm a beginner and am making a calculator (fairly easy), but it's happening the following p开发者_Python百科roblem: 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!
when you want to add a new number next to the old one, you probably need to
- get the value that is currently being shown in this "edit text" and save it in a string
- concatenate this old value with the new one that you want to add to your "edit text"
- set this new concatenated value as the new text in your "edit text"
:)
精彩评论